Comma and full point decimal problems between languages



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
.



Relevant Pages

  • Re: Comma and full point decimal problems between languages
    ... On Spanish based machines I get a floating point error. ... The numbers being used here are not in string format (they are read ... from the database independent of locale). ... application however ignores the locale settings of the PC and assumes ...
    (alt.comp.lang.borland-delphi)
  • language ?
    ... How can see the style of calligraphy of Spain? ... Remember that so long as joins in locale that can see the materials and ...
    (microsoft.public.windowsce.platbuilder)