Query example: select 1 as TAG, null as PARENT, '0' as "key", 7.27 as "value" for json explicit Result: [["0",7.26999999999999881]] As a result, value should be as in the original 7.27, the format of the field is numeric (12, 5) [["0",7.27]] I'll be grateful, cast, round, truncnum doesn't help |
JSON numbers are either integer or double-precision floating point. Values like 7.27 cannot be expressed exactly as a floating point number. One option is to process these values as strings. I agree when the string value is - works correctly. But then you have to convert to floating point number when building in Google Charts. And this is extra time. Thank you for your answer, I will try
(22 Nov '21, 02:37)
Aleksandr Ku...
Replies hidden
2
The problem is that at the end of the day, 2.7 cannot be accurately stored in base2 as a real number (just like 1/3 can't be exactly converted to base10) - you will always being dealing with some sort of approximation. Floating point numbers are a computer thing not a mathematical thing! I think decimal datatypes (when available) are stored as integer values and the appropriate offset then applied.
(22 Nov '21, 05:57)
Justin Willey
|