Hello,
either you recode the function below:

"function TJSONFloatNumber.GetAsString: TJSONStringType;
begin
  Str(FValue,Result);
end;
"

Either by changing to using formatted string conversion, using FloatToStrF 
function.
or 
by implementing your new type yourself, something like "TJSNExtFloatNumber" 
which overrides the GetAsString function. 

The second way should work without changing the JSON base code. However loading 
a JSON stream will still get you the base TJSONFloatNumber.

I hope this helps.
Thierry


----- Mail Original -----
De: "silvioprog" <silviop...@gmail.com>
À: "Lazarus mailing list" <lazarus@lists.lazarus.freepascal.org>
Envoyé: Vendredi 4 Novembre 2011 00h24:50 GMT +01:00 Amsterdam / Berlin / Berne 
/ Rome / Stockholm / Vienne
Objet: [Lazarus] JSON float saving scientific value

Hi,

I'm trying to save a float value: 1.5. But some class is converting
the value to "1.50000000000000E+000" (please see:
http://imagebin.org/182341).

How to I save the value exactly as 1.5?

My project test in attached.

Thx.

-- 
Silvio Clécio
===============================================
Blog - <silvioprog.com.br>
Twitter - <twitter.com/silvioprog>
Facebook - <facebook.com/silvioprog>
LazSolutions - <code.google.com/p/lazsolutions>
Lazarus-BR - <groups.google.com.br/group/lazarus-br?hl=pt-BR>
===============================================
   * Conheça nosso canal IRC sobre Lazarus: #lazarus-br *
===============================================

--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to