Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FloatToStr not working on german os ?

Status
Not open for further replies.

Tremorblue

Programmer
Apr 30, 2004
56
GB
I have written a program that is to run on different language versions of XP.

At present I have tried it on English ( No problems),
but when I run it on German, a function StrToFloat() always throws an error, even though the same number is being passed?

The error is like this "10.3 is not a valid floating point number"

Any help much appreciated.

/Tremor
 
It could be that you need to alter the '.' to ',' as the national rules actually states that as "so and so komma so and so" actually needs a comma in stead of the english world's dot.

Thus try with "10,3" in stead of "10.3" and i'm quite sure that it will pass without problems.

The workaround this is to make a text-replace based om country-information or entering the correct syntax. There's a standart called ISO......

Totte
Keep making it perfect and it will end up broken.
 
I found an answer - The global variable DecimalSeparator
contains the character that is used for floating point variables in the current locale.

/Tremor
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top