[fpc-pascal] Decimal dot

Michael Van Canneyt michael at freepascal.org
Thu May 8 22:02:16 CEST 2008



On Thu, 8 May 2008, Koenraad Lelong wrote:

> Hello,
> I need to log some real values so I write them to a file. Unfortunately
> the real's are in the form of xxx.yyy, mark the dot. If I try to import
> that file in OOo Calc, on the same PC, I get text-values instead of
> numbers. If I substitue the dots by comma's I get number-values and I
> can make graphs.
> Am I doing something wrong that fpc writes decimal dots and OOo expects
> comma's ? I think it's something to do with locales but I don't know
> where to look to configure things.

You need to set the DecimalSeparator character (to ',' in your case) , 
and format  your floats with floattostr or one of the other formatting 
routines in sysutils.

The system unit routines always use '.' as a decimal separator. If you don't
want to use the sysutils routines, use Str() to convert to a string, and replace
the dot with a comma in the resulting string.

Michael.



More information about the fpc-pascal mailing list