Post
Topic
Board Bitcoin Discussion
Re: TradeHill API was coded by amateurs
by
hoo2jalu
on 20/06/2011, 03:28:20 UTC
Sending decimal numbers as numbers invites clients to interpret them as floats and thereby introduce rounding errors. It's not a bad idea to transfer fixed point decimal numbers as strings.

Correct. This is actually a feature borne out of wisdom dealing with lots of different languages and runtimes which may not support floating point math accurately or as expected when doing conversions to other types.

gigi is the idiot.

EDIT: and just to clarify, using a string type let's you, the API user, determine how to re-cast and interpret the value rather than dealing with side effects of some implementation which tries to "do the right thing" by default.