Archive: Float Delimeter


Float Delimeter
How, I can set in Win98 FloatDelimeter (.)?



WriteRegStr HKU ".DEFAULT\Control Panel\International" "sDecimal" "."

Could you be more specific?
I don't understand what you need...

-Stu


My program use float number and get its from text-file.
I must set on client computer Float-point delimeter to (.).
On Win98 default (,).
My code don't work :'(


Try HKCU instead of HKU.

WriteRegStr HKCU "Control Panel\International" "sDecimal" "."

Originally posted by scrose
Try HKCU instead of HKU.
WriteRegStr HKCU "Control Panel\International" "sDecimal" "."
This not work too :'(

i think, this will only work after reboot.
maybe there's a windows api call to do set the delimiter directly, but couldn't find anything in the msdn :)


SetLocaleInfo, but How?


the setting you need is

LOCALE_SDECIMAL

so use this:

; first, get current locale id, store it in $0
System::Call "Kernel32::GetUserDefaultLCID(v)i .r0"
; then, set the float delimiter to '.', $1 gets return value, should be 1 on success
System::Call "Kernel32::SetLocaleInfo(i r0, i 'LOCALE_SDECIMAL', t '.')i .r1

not tested, but should work.

That won't work. You can't pass a string as a number. Replace 'LOCALE_SDECIMAL' with 0xE.


erm, yes, i already thought of this after posting and shutting down my computer :)
of course LOCALE_SDECIMAL is a constant that has to be defined, in this case as 0xE.
so, this will work:

!define LOCALE_SDECIMAL 0xE

; first, get current locale id, store it in $0
System::Call "Kernel32::GetUserDefaultLCID(v)i .r0"
; then, set the float delimiter to '.', $1 gets return value, should be 1 on success
System::Call "Kernel32::SetLocaleInfo(i r0, i ${LOCALE_SDECIMAL}, t '.')i .r1