int get_number_format(locale_identity locale,
                      unsigned flags,
                      const character* value,
                      const number_format_flags* number_format,
                      character* number,
                      int length)

This function formats a numeric string relative to a given locale's settings.


locale_identity locale

The locale identity. This identity may be formed via the function make_locale or it may be one of the predefined locales locale_system_default or locale_user_default.

If the parameter number_format is null, the locale is used to determine the format of the output string; otherwise, the locale is used only to determine information not specified in the format string (such as the negative symbol).

unsigned flags

The flag locale_types::use_no_override may be specified for this parameter, in which case, the system ANSI code page settings are utilized without making use of any locale overrides. This value may be used only if the parameter NumberFormat is non-null.

const character* value

A pointer to a string containing the number to be formatted. The string can contain:

If any other characters are presented, an error results.

const number_format_flags* number_format

A pointer to a structure that controls the formatting of numbers. If this parameter is null, the specified locale's numeric formatting flags are used.

character* number

A pointer to a buffer that is updated to hold the required numeric string.

int length

The size (in characters) of the buffer pointed to by the previous parameter. If zero is specified, the required buffer length is returned and the previous parameter is ignored.



If the parameter length is set to zero, the value returned is the number of characters required for the string to fit the buffer. If length is non-zero, the value returned is the number of characters transferred to the buffer. Zero is returned when an error occurs.