Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#12 fpspreadsheet: store float values without the exponent

closed-fixed
nobody
None
5
2009-11-14
2009-11-14
Luiz Camara
No

Currently, in open document files, the float value is stored with the string returned by Str procedure which uses the exponent format. As example, storing 4.2 will have the value 4.20000000000000E+000. If i open OO, edit the spreadsheet and then save this cell will get the value 4.2.

The attached patch saves float values using the compact format as returned by FloatToStr taking care to always use the dot as decimal separator, similar to OO.

Discussion

  • Luiz Camara
    Luiz Camara
    2009-11-14

     
    Attachments
  • Jose Mejuto
    Jose Mejuto
    2009-11-14

    I had fixed it with a different code which I think it is more clear what is done:

    FSettings.DecimalSeparator:='.';
    StrValue:=FloatToStr(AValue,FSettings); //Uses '.' as decimal separator
    DisplayStr:=FloatToStr(AValue); // Uses locale decimal separator

    Rev. 1007, please check if it is ok.

     
  • Luiz Camara
    Luiz Camara
    2009-11-14

    • status: open --> closed-fixed