"number" is an very ambiguous term. Integral or non-integral?
For developers in more dynamically-typed languages like JavaScript, this is not an issue; but when using more statically-typed languages like C#, developers need to know when an int
or long
should be used, as opposed to a double
.
It would be helpful if values that can be non-integral were more clearly indicated.
Update:
Yes, I understand that you are returning a "number" in JSON, so technically the spec is correct. But what good does that do your audience?
Should I make every object field and database column a float so it doesn't break unexpectedly because I guessed wrong what datatype I should use? Sure, I can guess, and in most cases guess correctly, but is that really the best thing possible?
"number" is of questionable value to all but the most trivial applications of the API, and downgrading the spec because of the limitations of transport is a mistake in my opinion.
decimal
do a developer working in javascript?float
,real
,double
, etc. are all constructs of particular languages;number
at least has a concrete meaning in context.decimal
doesn't exist in Java as a primitive type;real
is pretty vague; lets not even get started onstrictfp
. I'm just saying, its a lot more complicated than you're making it out to be. integral/non-integral even raises some length issues (dates > 32 bits, most everything else <= 32 bits; signed/unsigned is another question).number
needs to be made more specific, but doing so is non-trivial and accordingly will take some time.