Mailing lists / fpc-pascal / 2009-07
"VAL" and i18n
7 messages · 3 people ·
- JJonas Maebe 4
- TTorsten Bonde Christiansen 2
- MMichael Van Canneyt 1
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
Torsten Bonde Christiansen wroteAfter fiddling around with some local text i came across something odd. Is it true that the "val" function does not care for person i18n settings?
Yes.
Show quoted text 5 lines
It is the way val is intended to work. Use http://www.freepascal.org/docs-html/rtl/sysutils/floattostr.html instead if you want to make use of the locale settings (do not forget to use the "clocale" unit in your program if you are on a Unix platform to initialise the locale settings, or manually specify a TFormatSettings parameter to floattostr).
Jonas
Jonas Maebe wrote 7 lines
Oops, it's http://www.freepascal.org/docs-html/rtl/sysutils/strtofloat.html of course. Or http://www.freepascal.org/docs-html/rtl/sysutils/trystrtofloat.html if you don't want an exception if the conversion fails.
Jonas
Show quoted text 5 lines
It look like "Function TryStrToFloat(Const S : String; Out Value: Extended): Boolean" (extended version) is not documented. Is this because it's a 2.3.1 function or because it is not posible on all CPU's?
-Torsten.
Torsten Bonde Christiansen wrote 6 lines
http://www.freepascal.org/docs-html/rtl/sysutils/trystrtofloat.html
Jonas
It look like "Function TryStrToFloat(Const S : String; Out Value: Extended): Boolean" …
Torsten Bonde Christiansen wroteIt look like "Function TryStrToFloat(Const S : String; Out Value: Extended): Boolean" (extended version) is not documented. Is this because it's a 2.3.1 function or because it is not posible on all CPU's?
Sorry, the latter. It's between an {$ifdef FPC_HAS_TYPE_EXTENDED}, which probably makes the code documenter skip it.
Jonas
Jonas Maebe wrote 9 lines
I'll adapt the documentation generator so it enables these defines. There is also single, comp and maybe even some others.
Michael.
