3 ms·
> This is actually the beauty of JSON compared other formats where these things may end up being just a unitless integer. A field name doesn't turn an integer
by cratermoon 1y ago
> This is actually the beauty of JSON compared other formats where these things may end up being just a unitless integer.
A field name doesn't turn an integer field into a unit of anything.
Suffixing a unit as part of the value only makes the field stringly-typed an complicates parsing.
BTW weight can take fractional values.
That might not matter much for a 125kg adult,
but it certainly matters for a newborn weighing 3.1kg.
And I bring up weight because I personally identified a unit conversion bug in a well-known medical records suite where a weight measured in pounds was displayed as kilograms.
A dose of opioids sufficient to relieve traumatic pain in a 125kg person would kill someone who weighs 125lb.
Medical record software is not in the move-fast-break-things category.