please dont rip this site Prev Next

GetNumberFormat info  Overview  Group

The GetNumberFormat function formats a number string as a number string customized for a specified locale.

int GetNumberFormat(

    LCID Locale,

// locale for which number string is to be formatted

    DWORD dwFlags,

// bit flag that controls the function’s operation

    LPCTSTR lpValue,

// pointer to input number string

    CONST NUMBERFMT *lpFormat,

// pointer to a formatting information structure

    LPTSTR lpNumberStr,

// pointer to output buffer

    int cchNumber 

// size of output buffer



Specifies the locale for which the number string is to be formatted. If lpFormat is NULL, the function formats the string according to the number format for this locale. If lpFormat is not NULL, the function uses the locale only for formatting information not specified in the NUMBERFMT structure (for example, the locale’s string value for the negative sign).

This parameter can be a locale identifier created by the MAKELCID macro, or one of the following predefined values:


Default system locale.


Default user locale.

Contains a bit flag that controls the operation of the function. If lpFormat is non-NULL, this parameter must be zero.

If lpFormat is NULL, you can specify the LOCALE_NOUSEROVERRIDE flag to format the string using the system default number format for the specified locale; or you can specify zero to format the string using any user overrides to the locale’s default number format

Points to a null-terminated string containing the number string to format.

This string can only contain the following characters:

All other characters are invalid. The function returns an error if the string pointed to by lpValue deviates from these rules.

Pointer to a NUMBERFMT structure that contains number formatting information. All members in the structure pointed to by lpFormat must contain appropriate values.

If lpFormat is NULL, the function uses the number format of the specified locale.

Points to a buffer to receive the formatted number string.
Specifies the size, in bytes (ANSI version) or characters (Unicode version), of the lpNumberStr buffer. If cchNumber is zero, the function returns the number of bytes or characters required to hold the formatted number string, and the buffer pointed to by lpNumberStr is not used.

Return Values

If the function succeeds, the return value is the number of bytes (ANSI version) or characters (Unicode version) written to the buffer pointed to by lpNumberStr, or if the cchNumber parameter is zero, the number of bytes or characters required to hold the formatted number string.

If the function fails, the return value is zero. To get extended error information, call GetLastError. GetLastError may return one of the following error codes:


See Also

GetCurrencyFormat, NUMBERFMT

file: /Techref/os/win/api/win32/func/src/f35_16.htm, 5KB, , updated: 2000/4/7 12:19, local time: 2022/5/26 13:28,

 ©2022 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE!

<A HREF=""> GetNumberFormat</A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type a nice message (short messages are blocked as spam) in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.

Link? Put it here: 
if you want a response, please enter your email address: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?

  PICList 2022 contributors:
o List host: MIT, Site host, Top posters @20220526
* Page Editors: James Newton, David Cary, and YOU!
* Roman Black of Black Robotics donates from sales of Linistep stepper controller kits.
* Ashley Roll of Digital Nemesis donates from sales of RCL-1 RS232 to TTL converters.
* Monthly Subscribers: Gregg Rew. on-going support is MOST appreciated!
* Contributors: Richard Seriani, Sr.

Welcome to!