网站首页  词典首页

请输入您要查询的函数:

 

术语 getnumberformat
释义 GetNumberFormat
语法:
int GetNumberFormat(
__in LCID Locale,
__in DWORD dwFlags,
__in LPCTSTR lpValue,
__in const NUMBERFMT *lpFormat,
__out LPTSTR lpNumberStr,
__in int cchNumber
);
GetNumberFormat功能
至于标识符指定的区域设置自定义数字的字符串格式数字的字符串。
注意:对于互操作性的原因,应用程序应更喜欢GetNumberFormatEx功能GetNumberFormat,因为微软是对的,而不是新的区域设置的区域设置标识符地区名称的使用迁移。任何应用程序只能在Windows Vista和以后应使用GetNumberFormatEx运行。
参数
区域设置 [in]
区域设置标识符指定的语言环境。您可以使用MAKELCID宏创建一个区域设置标识符或使用下列预定义的值之一。
LOCALE_CUSTOM_DEFAULT
LOCALE_CUSTOM_UI_DEFAULT
LOCALE_CUSTOM_UNSPECIFIED
LOCALE_INVARIANT
LOCALE_SYSTEM_DEFAULT
LOCALE_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]
可选。缓冲区指针在本函数检索格式化数字的字符串。
cchNumber [in]
大小,在TCHAR价值,对数字的字符串缓冲区所指出的lpNumberStr。另外,应用程序可以设置为0参数。在此情况下,函数返回数字的字符串缓冲区所需的大小,以及不使用lpNumberStr参数。
返回值
返回TCHAR数字值检索的缓冲区lpNumberStr表示,如果成功的。如果cchNumber参数设置为0,则函数返回须持有格式化数字的字符串的字符数,包括终止空字符。
该函数返回0,如果没有成功。为了获得更多错误信息,应用程序可以调用GetLastError函数,可以返回以下错误代码之一:
ERROR_INSUFFICIENT_BUFFER。阿提供的缓冲区大小不够大,或者被错误地设置为NULL。
ERROR_INVALID_FLAGS。旗帜提供的值不是有效的。
ERROR_INVALID_PARAMETER。该参数值的任何无效。
ERROR_OUTOFMEMORY。没有足够的存储是可用于完成此操作。
备注
这个功能可以自定义区域设置检索数据。数据不能保证从同一计算机到计算机之间或应用程序的运行。如果应用程序必须坚持或传输数据,请参阅使用持久性本地化数据。
当此函数的ANSI版本,是使用一个Unicode只设置标识符,函数可以成功,因为操作系统使用系统代码页。然而,在字符系统代码页未定义出现在一个字符串问号(?)。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinnls.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
Unicode和ANSI namesGetNumberFormatW(Unicode)和GetNumberFormatA(ANSI)的
参见
国家语言支持
国家语言支持功能
GetNumberFormatEx
NUMBERFMT
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月12号
==英文原文==GetNumberFormat Function
Formats a number string as a number string customized for a locale specified by identifier.
Note For interoperability reasons, the application should prefer the GetNumberFormatEx function to GetNumberFormat because Microsoft is migrating toward the use of locale names instead of locale identifiers for new locales. Any application that runs only on Windows Vista and later should use GetNumberFormatEx.
Syntax
int GetNumberFormat(
__in LCID Locale,
__in DWORD dwFlags,
__in LPCTSTR lpValue,
__in const NUMBERFMT *lpFormat,
__out LPTSTR lpNumberStr,
__in int cchNumber
);
Parameters
Locale [in]
Locale identifier that specifies the locale. You can use the MAKELCID macro to create a locale identifier or use one of the following predefined values.
LOCALE_CUSTOM_DEFAULT
LOCALE_CUSTOM_UI_DEFAULT
LOCALE_CUSTOM_UNSPECIFIED
LOCALE_INVARIANT
LOCALE_SYSTEM_DEFAULT
LOCALE_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 this parameter does is not set to NULL, the function uses the locale only for formatting information not specified in the structure, for example, the locale-specific string value for the negative sign.
lpNumberStr [out]
Optional. Pointer to a buffer in which this function retrieves the formatted number string.
cchNumber [in]
Size, in TCHAR values, 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 TCHAR values 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.
Remarks
This function can retrieve data from custom locales . Data is not guaranteed to be the same from computer to computer or between runs of an application. If your application must persist or transmit data, see Using Persistent Locale Data .
When the ANSI version of this function is used with a Unicode-only locale identifier, the function can succeed because the operating system uses the system code page. However, characters that are undefined in the system code page appear in the string as a question mark (?).
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinnls.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
Unicode and ANSI namesGetNumberFormatW (Unicode) and GetNumberFormatA (ANSI)
See Also
National Language Support
National Language Support Functions
GetNumberFormatEx
NUMBERFMT
Send comments about this topic to Microsoft
Build date: 7/12/2009
==原始网址==http://msdn.microsoft.com/en-us/library/dd318110(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:22:50