Den SubStr würde ich heute perfomanter bauen (zusammen mit meiner aktuellen funktion)
Code: Select all
GetNumberFormatEx(Value, LocaleName := "!x-sys-default-locale") ; Windows Vista and later
{
if (Size := DllCall("GetNumberFormatEx", "str", LocaleName, "uint", 0, "str", Value, "ptr", 0, "ptr", 0, "int", 0)) {
VarSetCapacity(NumberStr, Size << !!A_IsUnicode, 0)
if (DllCall("GetNumberFormatEx", "str", LocaleName, "uint", 0, "str", Value, "ptr", 0, "str", NumberStr, "int", Size))
return SubStr(NumberStr, 1, -3)
}
return false
}
GetNumberFormat(Value, Locale := 0x0400) ; Windows 2000 and later
{
if (Size := DllCall("GetNumberFormat", "uint", Locale, "uint", 0, "str", Value, "ptr", 0, "ptr", 0, "int", 0)) {
VarSetCapacity(NumberStr, Size << !!A_IsUnicode, 0)
if (DllCall("GetNumberFormat", "uint", Locale, "uint", 0, "str", Value, "ptr", 0, "str", NumberStr, "int", Size))
return SubStr(NumberStr, 1, -3)
}
return false
}