decimal separators

Advanced game related topics
lioralo
New User
New User
Posts: 2
Joined: Mon Dec 29, 2008 2:14 pm

decimal separators

Post by lioralo »

HI
I'M TRYING TO FIND OUT WHICH KIND OF DECIMAL SEPARATOR IS IN USE IN HOLLAND
IS IT COMMON TO USE 20'OOO INSTEAD OF 20,000 OR 20.000 OR IN ANOTHER EUROPEAN COUNTRY?
MANY THANKS
LIORA
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Post by Num3 »

User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post by Kaeru Gaman »

in germany, we use the point as thousands separator and the comma as decimal separator.

the apostroph would easier be understood as thousand separator than the comma.

after reading the Wiki article, I would second the recommendation of IUPAC:
"For numbers with many digits, the digits may be separated in groups of three, counting from the decimal sign toward the left and the right. The groups should be separated by a thin space (half space), and never by a comma or a point, or by any other means."
oh... and have a nice day.
lioralo
New User
New User
Posts: 2
Joined: Mon Dec 29, 2008 2:14 pm

Post by lioralo »

manu many thanks for your answer :P :
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: decimal separators

Post by PB »

NEVER hard-code a decimal separator into your app. Get it from the PC's
locale settings, like so:

Code: Select all

decsep$=" "
GetLocaleInfo_(#LOCALE_USER_DEFAULT,#LOCALE_SDECIMAL,decsep$,1)
Debug decsep$
Disclaimer #1: This works on Windows only.

Disclaimer #2: I'm not sure if more than 1 character is used for a separator.
If it is, then add some more spaces to the string and change "1" to that many
spaces.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6172
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

Although the OFFICIAL (hey, that's a word in ALLCAPS) way to write it in dutch is comma's for the decimal points, many dutch have converted to the english way, using dots.

Oh, the bad things computers do to us.
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
Post Reply