[code] dim js as new JSONItem(data)
dim ticker as JSONItem = js.Value(“result”)
ticker.DecimalFormat = “#.######”
dim bid as string
dim ask as string
dim last as string
bid = ticker.value(“Bid”)
ask = ticker.value(“Ask”)
last = ticker.value(“Last”)
it should display the number like 0.0019700 but instead it displays some crazy long
1.969999999999999999e-14 (or something like that…) what in the heck is going on…
Anyone can help ?
He just got confused for a moment about stored value x presentation needing formating.
The .DecimalFormat is used just when converting the JSONItem toString()
When the other side receives a number, formated as you desired, its converted back to it’s internal numeric representation (maybe truncated as you could have instructed).
Any case, any side, a pure numeric item needs formating to the presentation, or the system will use an arbitrary “best fit” format for that value. Like the String = Variant as it was made.