About Thousand & Decimal Separator

About Thousand & Decimal Separator
----------------------------------

How to get Thousand and Decimal separator of the current regional setting?
If I set Thousand & Decimal separator by myself in Control Panel,
the values will be stored in registry: HKEY_CURRENT_USER\Control Panel\International
with keys: 'sThousand' and 'sDecimal'.
But, when I restore it to the original value in Control Panel, then keys:
'sThousand' & 'sDecimal' will be disappeared from registry.
So, how to handle this?

Regards,

Daniel Cahya
LVL 7
daniel_cAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
AttarSoftwareConnect With a Mentor Commented:
Yeah, I found that StrToFloat sucks...

On some machines, if the string is not initialised properly, you get a bluescreen crash with this function also...

Anyways, if no-one minds, I'll claim this question as answered :)  Cheers for increasing my knowledge too :)

Tim.
0
 
AttarSoftwareCommented:
In Delphi, the variables :

decimalSeparator

and

thousandSeparator

are pre-defined...just use them...

Hope this helps,

Tim.
0
 
RBertoraCommented:
Attarsoftware is 100% correct,
look at the delphi help under:

"Currency and date/time formatting variables"

or just get help on
ThousandSeparator ect..

Rob ;-)
0
Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

 
daniel_cAuthor Commented:
okay, i'll take a look of that!
0
 
AttarSoftwareCommented:
*bow* ;OD

Tim.
0
 
StefaanCommented:
Hi,

One more thing.  It is best to set the ThousandSeperator and DecimalSeperator in the FormCreate of your first (main) form.

At least that is how I do it ;-)

Best regards,


Stefaan
0
 
RBertoraCommented:
:-)
0
 
AttarSoftwareCommented:
Why would you need to set them?  Aren't they automatically set to the computers country settings?

Yours confusedly,

Tim.
0
 
RBertoraCommented:
Often country settings <> what user wants.
Rob;-)
0
 
AttarSoftwareCommented:
Ahhh...

Stoopid users ;O)

Tim.
0
 
sburckCommented:
And another comment to AttarSoftware:  Often you will get a string formatted using the system defaults, and some external functions which don't use these will fail.  We did a setup in Slovakia which got some decimal number with a ',' for a decimal separator, and called StrToFloat, which gave us an exception (and the same system on English Windows worked fine).
0
All Courses

From novice to tech pro — start learning today.