Comma and full point decimal problems between languages
- From: Granty <grant@xxxxxxxxxxx>
- Date: Tue, 29 Jan 2008 03:31:01 -0800 (PST)
Hi All,
I have found similar posts to this one, but not one which nails my
particular problem.
I work in Spain but my PC is English/UK configured. When I deploy my
finished application other users with a Spanish (SP) configuration
experience a problem I don't get on my machine. Here is the scenario:
A real number is read from a database. This is then used in a
calculation. On Spanish based machines I get a floating point error. I
am assuming that this is to do with the locale as in the UK we use the
comma to separate thousands and a full point the decimal. In Spain
(and a lot of the continent) this is reversed:
UK: 12,189.20
SP: 12.189,20
The numbers being used here are not in string format (they are read
from the database independent of locale). It seems that the
application however ignores the locale settings of the PC and assumes
it to be using UK numbering format. At the point when it performs the
calculation it crashes with a floating point error.
Are there settings within Delphi which can be altered at run time to
handle this problem? I can possibly get around it by converting to
strings and playing around that way changing the separators and
decimal points but this seems like a lot of unnecessary messing about
and adds yet more unwanted coding.
Thanks.
Granty
.
- Follow-Ups:
- Re: Comma and full point decimal problems between languages
- From: Maarten Wiltink
- Re: Comma and full point decimal problems between languages
- From: jmverdi
- Re: Comma and full point decimal problems between languages
- Prev by Date: Re: Frank's Delphi Lessons ?
- Next by Date: Re: Comma and full point decimal problems between languages
- Previous by thread: Frank's Delphi Lessons ?
- Next by thread: Re: Comma and full point decimal problems between languages
- Index(es):
Relevant Pages
|