Mart
(KiX Supporter)
2007-07-11 02:51 PM
Decimal separator US vs EU

There is some region specific stuff going on with the decimal separator.
See: http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=177753&page=0


LonkeroAdministrator
(KiX Master Guru)
2007-07-11 03:15 PM
Re: Decimal separator US vs EU

why this is in suggestions?

anyways, the behavior is feature, not a bug.


Arend_
(MM club member)
2007-07-11 05:15 PM
Re: Decimal separator US vs EU

The behavior is quite normal, alot of administrative programs count on these regional settings to be setup properly.

Witto
(MM club member)
2007-07-11 05:29 PM
Re: Decimal separator US vs EU

Maybe a macro to find the correct sign?
Some suggestions for a name:
@DecimalSeparator
@DecSep
@Dec


Arend_
(MM club member)
2007-07-11 06:29 PM
Re: Decimal separator US vs EU

 Code:
Function DecimalSeparator
  $DecimalSeparator = ReadValue('HKCU\Control Panel\International','sDecimal')
EndFunction


:P


LonkeroAdministrator
(KiX Master Guru)
2007-07-11 07:43 PM
Re: Decimal separator US vs EU

heh.
how about a udf:
http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=83979


Mart
(KiX Supporter)
2007-07-11 08:38 PM
Re: Decimal separator US vs EU

Ok, ok suggestions might not be the best place for this.

I guess there are several ways to get the decimal separator from the OS and use that in your script but it would be nice if kix just took the decimal symbol set in the regional settings.


LonkeroAdministrator
(KiX Master Guru)
2007-07-11 09:24 PM
Re: Decimal separator US vs EU

but that's the point.
kixtart uses exactly that decimal symbol.

and if you look at my udf, it's quite simple and does not retrieve the info from anywhere.


Mart
(KiX Supporter)
2007-07-11 10:20 PM
Re: Decimal separator US vs EU

 Quote:

....
kixtart uses exactly that decimal symbol.
....


Well then maybe I just don't get it because when I runt his code:

 Code:
Break on

$dot = 2 * 1.5
?$dot

$comma = 2 * 1,5
?$comma

Sleep 5


the second calculation never works and the first one always works. No matter what I put in the regional settings?
Like I said maybe I just don’t get it but that’s why I'm asking you guys to shed some light on it.


LonkeroAdministrator
(KiX Master Guru)
2007-07-11 10:27 PM
Re: Decimal separator US vs EU

well, that's just because "," is parameter separator and some more.
like in your example, array field separator.
so, what you actually do is simply:
global $comma[1]
$comma[0] = 2 * 1
$comma[1] = 5

now, if kix would use "," as decimal as you seemed to suggest...
how would one define arrays or separate parameters for function calls?

what I ment in my previous post is that when you have decimal place inside string, it gets translated to numeric with the decimal symbol of your OS.


Mart
(KiX Supporter)
2007-07-11 11:09 PM
Re: Decimal separator US vs EU

Ah it's like that. Now I get it. Thanx.

Glenn BarnasAdministrator
(KiX Supporter)
2007-07-12 01:08 AM
Re: Decimal separator US vs EU

[quote=Mart]
 Quote:

Well then maybe I just don't get it because when I runt his code:


Hmm, and I thought that the problem was that Mart was RUNTing his code.. Is that slang for "deprecating"?

;\)

Glenn - glad to live in a land where commas are commas, and dots are dots - PERIOD!


NTDOCAdministrator
(KiX Master)
2007-07-12 02:12 AM
Re: Decimal separator US vs EU

So can this be moved to basic forum now?

Mart
(KiX Supporter)
2007-07-12 09:37 AM
Re: Decimal separator US vs EU

 Originally Posted By: Glenn Barnas
[quote=Mart]
 Quote:

Well then maybe I just don't get it because when I runt his code:


Hmm, and I thought that the problem was that Mart was RUNTing his code.. Is that slang for "deprecating"?

;\)

....


Damn those freaking typo’s ;\)