网站首页  词典首页

请输入您要查询的函数:

 

术语 getnumberformatex
释义 GetNumberFormatEx
语法:
int GetNumberFormatEx(
__in LPCWSTR lpLocaleName,
__in DWORD dwFlags,
__in LPCWSTR lpValue,
__in const NUMBERFMT *lpFormat,
__out LPWSTR lpNumberStr,
__in int cchNumber
);
GetNumberFormatEx功能
如按名称指定的区域设置自定义数字的字符串格式数字的字符串。
注意:应用程序应优先调用此函数来GetNumberFormat运行而设计的,如果仅在Windows Vista和更高版本。
注意:此功能可以改变数据格式之间的版本,例如,由于自定义区域。如果应用程序必须坚持或传输数据,请参阅使用持久性本地化数据。
参数
lpLocaleName [in]
可选。指针区域的名称,或以下预定义值之一。
LOCALE_NAME_INVARIANT
LOCALE_NAME_SYSTEM_DEFAULT
LOCALE_NAME_USER_DEFAULT
dwFlags [in]
旗控制的功能操作。应用程序必须设置此参数为0,如果lpFormat未设置为NULL。在这种情况下,该函数的格式字符串使用用户覆盖到的语言环境的默认数字格式。如果lpFormat设置为NULL,应用程序可以指定LOCALE_NOUSEROVERRIDE格式化字符串使用指定的语言环境的系统默认的数字格式。
警示LOCALE_NOUSEROVERRIDE强烈建议不要使用,因为它禁用用户的喜好。
lpValue [in]
指向一个以NULL结尾的字符串包含数字的字符串的格式。这个字符串只能包含以下字符。所有其他字符是无效的。该函数返回一个错误,如果字符串由这些规则lpValue偏离说明。
字符“0”到“9”。
一个小数点(点)如果数字是一个浮点值。
月的第一个字符的位置减号如果数字是一个负值。
lpFormat [in]
可选。指针NUMBERFMT结构,它包含的信息以数字格式设置为适当的值的所有成员。如果应用程序不设置此参数为NULL,则函数只使用格式化没有在指定的信息结构的语言环境,例如,对负号区域字符串值。
lpNumberStr [out]
可选。缓冲区指针在本函数检索格式化数字的字符串。另外,此参数包含NULL如果cchNumber设置为0。在这种情况下,函数返回数字的字符串缓冲区所需的大小。
cchNumber [in]
大小,字符,数字的字符串缓冲区所指出的lpNumberStr。另外,应用程序可以设置为0参数。在这种情况下,函数返回数字的字符串缓冲区所需的大小,不使用lpNumberStr参数。
返回值
返回检索的数目在缓冲区lpNumberStr表示,如果成功的字符。如果cchNumber参数设置为0,则函数返回须持有格式化数字的字符串的字符数,包括终止空字符。
该函数返回0,如果没有成功。为了获得更多错误信息,应用程序可以调用GetLastError函数,可以返回以下错误代码之一:
ERROR_INSUFFICIENT_BUFFER。阿提供的缓冲区大小不够大,或者被错误地设置为NULL。
ERROR_INVALID_FLAGS。旗帜提供的值不是有效的。
ERROR_INVALID_PARAMETER。该参数值的任何无效。
ERROR_OUTOFMEMORY。没有足够的存储是可用于完成此操作。
要求:
client最低支持Vista
server最低支持 Windows Server 2008
HeaderWinnls.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
参见
国家语言支持
国家语言支持功能
GetNumberFormat
NUMBERFMT
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月12号
==英文原文==GetNumberFormatEx Function
Formats a number string as a number string customized for a locale specified by name.
Note The application should call this function in preference to GetNumberFormat if designed to run only on Windows Vista and later.
Note This function can format data that changes between releases, for example, due to a custom locale. If your application must persist or transmit data, see Using Persistent Locale Data .
Syntax
int GetNumberFormatEx(
__in LPCWSTR lpLocaleName,
__in DWORD dwFlags,
__in LPCWSTR lpValue,
__in const NUMBERFMT *lpFormat,
__out LPWSTR lpNumberStr,
__in int cchNumber
);
Parameters
lpLocaleName [in]
Optional. Pointer to a locale name , or one of the following predefined values.
LOCALE_NAME_INVARIANT
LOCALE_NAME_SYSTEM_DEFAULT
LOCALE_NAME_USER_DEFAULT
dwFlags [in]
Flags controlling the operation of the function. The application must set this parameter to 0 if lpFormat is not set to NULL. In this case, the function formats the string using user overrides to the default number format for the locale. If lpFormat is set to NULL, the application can specify LOCALE_NOUSEROVERRIDE to format the string using the system default number format for the specified locale.
Caution Use of LOCALE_NOUSEROVERRIDE is strongly discouraged as it disables user preferences.
lpValue [in]
Pointer 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 indicated by lpValue deviates from these rules.
Characters "0" through "9".
One decimal point (dot) if the number is a floating-point value.
A minus sign in the first character position if the number is a negative value.
lpFormat [in]
Optional. Pointer to a NUMBERFMT structure that contains number formatting information, with all members set to appropriate values. If the application does not set this parameter to NULL, the function uses the locale only for formatting information not specified in the structure, for example, the locale string value for the negative sign.
lpNumberStr [out]
Optional. Pointer to a buffer in which this function retrieves the formatted number string. Alternatively, this parameter contains NULL if cchNumber is set to 0. In this case, the function returns the required size for the number string buffer.
cchNumber [in]
Size, in characters, for the number string buffer indicated by lpNumberStr. Alternatively, the application can set this parameter to 0. In this case, the function returns the required size for the number string buffer and does not use the lpNumberStr parameter.
Return Value
Returns the number of characters retrieved in the buffer indicated by lpNumberStr if successful. If the cchNumber parameter is set to 0, the function returns the number of characters required to hold the formatted number string, including a terminating null character.
The function returns 0 if it does not succeed. To get extended error information, the application can call GetLastError , which can return one of the following error codes:
ERROR_INSUFFICIENT_BUFFER. A supplied buffer size was not large enough, or it was incorrectly set to NULL.
ERROR_INVALID_FLAGS. The values supplied for flags were not valid.
ERROR_INVALID_PARAMETER. Any of the parameter values was invalid.
ERROR_OUTOFMEMORY. Not enough storage was available to complete this operation.
Requirements
Minimum supported clientWindows Vista
Minimum supported serverWindows Server 2008
HeaderWinnls.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
See Also
National Language Support
National Language Support Functions
GetNumberFormat
NUMBERFMT
Send comments about this topic to Microsoft
Build date: 7/12/2009
==原始网址==http://msdn.microsoft.com/en-us/library/dd318113(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 11:28:30