Function Reference


Formats a number string as a number string customized for a locale specified by identifier

#include <WinAPILocale.au3>
_WinAPI_GetNumberFormat ( $iLCID, $sNumber [, $tNUMBERFMT = 0] )


$iLCID The locale identifier (LCID) that specifies the locale or one of the following predefined values.

Windows Vista or later
$sNumber The string containing the number string to format. This string can only contain the following
characters. All other characters are invalid.

Characters "0" through "9".
A minus sign in the first character position if the number is a negative value.
One decimal point (dot) if the number is a floating-point value.
$tNUMBERFMT [optional] $tagNUMBERFMT structure that contains number formatting information. If this parameter is 0 (Default),
the function returns the string according to the number format for the specified locale.
You can use the _WinAPI_CreateNumberFormatInfo() function to create this structure.

Return Value

Success: The formatted number string.
Failure: Empty string, call _WinAPI_GetLastError() to get extended error information.



See Also

Search GetNumberFormat in MSDN Library.


#include <WinAPILocale.au3>

Local $sNumber = '123456789'

ConsoleWrite(_WinAPI_GetNumberFormat(0, $sNumber) & @CRLF)
ConsoleWrite(_WinAPI_GetNumberFormat(0, $sNumber, _WinAPI_CreateNumberFormatInfo(0, 1, 3, '', ',', 1)) & @CRLF)