Menu

#3 Incorrect toString for _double

v1.0_(example)
open
nobody
None
5
2011-05-30
2011-05-30
No

The function toString:string of _Double returns the value in quotationmarks, which is not standard JSON.
It also loses precision, since formatFloat is used with a formatstring which has only 2 digits after the decimal point.

Solution:
function _Double.toString: string;
begin
result := StringReplace(FloatToStr(fvalue),',','.',[rfReplaceAll]);
end;

Discussion


Log in to post a comment.