[fpc-devel] ThousandSeparator

Frederic Da Vitoria davitofrg at gmail.com
Thu Nov 27 09:53:10 CET 2014

2014-11-26 16:54 GMT+01:00 Hans-Peter Diettrich <DrDiettrich1 at aol.com>:

> 2) Formatted numbers, as enterd by the user (maybe by copy&paste from
> other applications), can have various encodings. Before a conversion into
> binary values I'd remove all unexpected characters, except for the last
> (rightmost) '.' or ',', which then becomes the decimal separator as
> expected by the decoding function (RTL provided).

You mean that the first string to be converted to binary would
automatically set the decimal separator? That would seem dangerous to me.
What if the first string to be converted contained something like "11,000",
does this mean 11000 with thousand separator = comma (which would be true
in at least USA), or 11 with decimal separator = comma (which would be
true at least in France)? I can't think of any way to choose automatically.
AFAICS, the code needs either to use the system settings or to be told
explicitly by the developer. Even relying on the system settings may not be
enough, because one may need to "import" data formatted with different
national settings from the system's settings.

Frederic Da Vitoria

Membre de l'April - « promouvoir et défendre le logiciel libre » -
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20141127/3ebdb0f0/attachment.html>

More information about the fpc-devel mailing list