[fpc-pascal] Formatting of JSON float values

Michael Van Canneyt michael at freepascal.org
Wed Dec 2 19:26:46 CET 2015



On Wed, 2 Dec 2015, Graeme Geldenhuys wrote:

> On 2015-12-02 18:17, Michael Van Canneyt wrote:
>> No, currently not. The value is formatted in TFloatNumber.GetAsString.
>
> Ok, thanks.
>
> Second question. What happens to floating points with different locales
> and decimal separators? eg: USA and UK uses a dot (.) as decimal
> separator, but [odd] countries like South Africa use a comma (,) - would
> this affect FPC's JSON read/write?
>
> Or does the JSON specification define the decimal separator to always be
> a dot?

The decimal separator is always a dot.

The value is formatter using str from the system unit, and disregards any locale.

Michael.



More information about the fpc-pascal mailing list