Subject:
|
Re: Delphi and decimal signs.
|
Newsgroups:
|
lugnet.cad.dev
|
Date:
|
Mon, 20 Aug 2001 19:11:09 GMT
|
Viewed:
|
389 times
|
| |
![Post a public reply to this message](/news/icon-reply.gif) | |
Tore Eriksson wrote:
> Look at following Delphi code:
> s: string;
> f: double;
> i: Integer;
> begin
> f := 3.14; // correct
> f := 3,14; // error (of course...)
> f := StrToFloat('3.14'); // error
> f := StrToFloat('3,14'); // correct
> s := FloatToStr(3.14); // s is assigned '3,14'
With careful manipulation of the DecimalSeparator and ThousandSeparator
global variables, one could write a Delphi app that reads/writes periods
(full stop symbols) from/to DAT files, but displays the locale-specific
symbols to the user and also allows the user to type in locale-specific
symbols.
-Gary
|
|
Message has 1 Reply: ![](/news/x.gif) | | Re: Delphi and decimal signs.
|
| Careful manipulation? All I need to do is add the line DecimalSeparator := '.'; to FormCreate and all my problems are gone! Gary, you are a hero! I'll check out ThousandSeparator later. Thanks again! /Tore (...) (23 years ago, 20-Aug-01, to lugnet.cad.dev)
|
Message is in Reply To:
![](/news/x.gif) | | Delphi and decimal signs.
|
| Look at following Delphi code: s: string; f: double; i: Integer; begin f := 3.14; // correct f := 3,14; // error (of course...) f := StrToFloat('3.14'); // error f := StrToFloat('3,14'); // correct s := FloatToStr(3.14); // s is assigned '3,14' Is (...) (23 years ago, 20-Aug-01, to lugnet.cad.dev)
|
7 Messages in This Thread: ![Delphi and decimal signs. -Tore Eriksson (20-Aug-01 to lugnet.cad.dev)](/news/x.gif) ![](/news/246.gif) ![Re: Delphi and decimal signs. -Gary Williams (20-Aug-01 to lugnet.cad.dev)](/news/x.gif) ![](/news/46.gif) ![Re: Delphi and decimal signs. -Tore Eriksson (20-Aug-01 to lugnet.cad.dev)](/news/x.gif)
![](/news/x.gif) ![](/news/268.gif) ![You are here](/news/here.gif) ![](/news/46.gif) ![Re: Delphi and decimal signs. -Tore Eriksson (20-Aug-01 to lugnet.cad.dev)](/news/x.gif)
![](/news/x.gif) ![](/news/68.gif) ![Re: Delphi and decimal signs. -Anders Isaksson (20-Aug-01 to lugnet.cad.dev)](/news/x.gif) ![](/news/46.gif) ![Re: Delphi and decimal signs. -Gary Williams (20-Aug-01 to lugnet.cad.dev)](/news/x.gif)
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
This Message and its Replies on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|