Board index » delphi » FloatToStr problems with formatted floats

FloatToStr problems with formatted floats

Hello,

In Portugal our number format is "0 000,00" (although Windows says
"0.000,00") and, when I want to reuse a formatted number as a float I get
an exception saying 'Invalid Float'.

Must I keep a float var with the value unformatted?

Can you give me any help?

--
Please reply by e-mail
____________________

Pedro Vaz
pedro...@student.dei.uc.pt
____________________

 

Re:FloatToStr problems with formatted floats


Quote
Pedro Vaz wrote:

> Hello,

> In Portugal our number format is "0 000,00" (although Windows says
> "0.000,00") and, when I want to reuse a formatted number as a float I get
> an exception saying 'Invalid Float'.

> Must I keep a float var with the value unformatted?

> Can you give me any help?

> --
> Please reply by e-mail
> ____________________

> Pedro Vaz
> pedro...@student.dei.uc.pt
> ____________________

I think you have to change the windows environment variables regarding
the delimiter used to denote the end of the integer portion and start of
the fraction portion. In Win95 the regional settings window of the
Control panel allows you to change the Decimal symbol to a space. I
don't know if this symbol is used in converting from string to value,
but it's a way to try.

You can also access the symbols from inside Delphi. Just search the help
systems for 'Currency and date/time formatting variables'.

Hope it helps.

Dave Joyce

Other Threads