I made a few changes to the card price JSON API today and wanted to outline them here. I added all statistics that are available from Magic Trader's pricelists to the interface, which include price, high, low, change, average, and volume (which is called "raw number" in Magic Trader's lists). I calculate the percent change, so I have also made that available.
"15.99" * 1 = 15.99
volume attribute is a number, but all other number values will remain strings. Rather than dealing with rounding issues, the numbers will remain stringified. Just multiply by 1 if you want to compare any of the values as a number.
prices["change"] * 1 >= 0 will tell you whether the card went up in price today.
Price Ticker Updates
After learning how jQuery handles JSONP, I fixed the API so it can safely create as many price tickers on a single page as you like. Previously, tickers were using the same global method named
jsonp, which essentially caused a race condition when putting multiple tickers on a single page. Like jQuery, each ticker now uses a unique identifier to insure tickers don't clash on their JSONP function names.