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?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
daniel_cAuthor Commented:
okay, i'll take a look of that!
0
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

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
AttarSoftwareCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.