You are not logged in.
Hi all,
when i try to convert the float value in IDocDict, the value is returned as added 0.
LDict := DocDict('{"FloatVal": 24.4}');
ShowMessage(LDict.S['FloatVal']);
the value is displayed as "24.40" not "24.4".
Please give me some advice how to get the exact value using .S[] function.
Offline
The value is stored as variant, and in the variant it is stored as varCurrency.
If the default conversion to text does not please you, the easiest is to use the system conversion.
So you could just write:
ShowMessage(LDict['FloatVal']);
In fact, LDict['FloatVal'] returns a variant, which is converted to string by the RTL as you expect.
Note that LDict.ToJson() works as you expect.
See https://github.com/synopse/mORMot2/commit/8e5c2152
Offline