Skip to content
⌘ NSIS Forum Archive

Float Delimeter

11 posts

KirillKr#
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 :'(
KirillKr#
Originally posted by scrose
Try HKCU instead of HKU.
WriteRegStr HKCU "Control Panel\International" "sDecimal" "."
This not work too :'(
Comm@nder21#
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 🙂
Comm@nder21#
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.
Comm@nder21#
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