网站首页  词典首页

请输入您要查询的函数:

 

术语 getcurrencyformat
释义 GetCurrencyFormat
语法:
int GetCurrencyFormat(
__in LCID Locale,
__in DWORD dwFlags,
__in LPCTSTR lpValue,
__in const CURRENCYFMT *lpFormat,
__out LPTSTR lpCurrencyStr,
__in int cchCurrency
);
GetCurrencyFormat功能
作为由标识符指定的区域货币字符串格式数字的字符串。
注意:对于互操作性的原因,应用程序应更喜欢GetCurrencyFormatEx功能GetCurrencyFormat,因为微软是对的,而不是新的区域设置的区域设置标识符地区名称的使用迁移。任何应用程序只能在Windows Vista和以后应使用GetCurrencyFormatEx运行。
参数
区域设置 [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结尾的字符串包含数字的字符串的格式。这个字符串只能包含以下字符。所有其他字符是无效的。该函数返回一个错误,如果字符串偏离这些规则。
字符“0”到“9”
一个小数点(点)如果数字是一个浮点值
月的第一个字符的位置减号如果数字为负值
lpFormat [in]
可选。指针CURRENCYFMT结构,它包含货币格式的信息。结构的所有成员必须包含适当的值。应用程序可以将此参数设置为NULL如果功能是使用指定的区域设置货币格式。如果这个参数不设置为NULL,则函数只使用格式化没有在CURRENCYFMT结构中指定的信息指定的语言环境,例如,由区域使用的负号的字符串值。
lpCurrencyStr [out]
可选。缓冲区指针在本函数检索格式化货币字符串。
cchCurrency [in]
大小,以字符,在lpCurrencyStr缓冲区。应用程序设置此参数为0,如果该函数返回的须持有货币的格式化字符串缓冲区的大小。在这种情况下,lpCurrencyStr参数不使用。
返回值
返回检索的数目在缓冲区lpCurrencyStr表示,如果成功的字符。如果cchCurrency参数设置为0,则函数返回须持有货币的格式化字符串缓冲区,其中包括终止空字符的大小。
该函数返回0,如果没有成功。为了获得更多错误信息,应用程序可以调用GetLastError函数,可以返回以下错误代码之一:
ERROR_INSUFFICIENT_BUFFER。阿提供的缓冲区大小不够大,或者被错误地设置为NULL。
ERROR_INVALID_FLAGS。旗帜提供的值不是有效的。
ERROR_INVALID_PARAMETER。该参数值的任何无效。
备注
这个功能可以自定义区域设置检索数据。数据不能保证从同一计算机到计算机之间或应用程序的运行。如果应用程序必须坚持或传输数据,请参阅使用持久性本地化数据。
当此函数的ANSI版本,是使用一个Unicode只设置标识符,可以调用成功,因为操作系统使用系统代码页。然而,在字符系统代码页未定义出现在一个字符串问号(?)。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinnls.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
Unicode和ANSI namesGetCurrencyFormatW(Unicode)和GetCurrencyFormatA(ANSI)的
参见
国家语言支持
国家语言支持功能
GetCurrencyFormatEx
GetNumberFormat
CURRENCYFMT
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月12号
==英文原文==GetCurrencyFormat Function
Formats a number string as a currency string for a locale specified by identifier.
Note For interoperability reasons, the application should prefer the GetCurrencyFormatEx function to GetCurrencyFormat 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 GetCurrencyFormatEx .
Syntax
int GetCurrencyFormat(
__in LCID Locale,
__in DWORD dwFlags,
__in LPCTSTR lpValue,
__in const CURRENCYFMT *lpFormat,
__out LPTSTR lpCurrencyStr,
__in int cchCurrency
);
Parameters
Locale [in]
Locale identifier that specifies the locale for which this function formats the currency string. 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 currency format. 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 currency format for the locale. If lpFormat is set to NULL, the application can specify LOCALE_NOUSEROVERRIDE to format the string using the system default currency 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 contain only the following characters. All other characters are invalid. The function returns an error if the string 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 CURRENCYFMT structure that contains currency formatting information. All members of the structure must contain appropriate values. The application can set this parameter to NULL if function is to use the currency format of the specified locale. If this parameter is not set to NULL, the function uses the specified locale only for formatting information not specified in the CURRENCYFMT structure, for example, the string value for the negative sign used by the locale.
lpCurrencyStr [out]
Optional. Pointer to a buffer in which this function retrieves the formatted currency string.
cchCurrency [in]
Size, in characters, of the lpCurrencyStr buffer. The application sets this parameter to 0 if the function is to return the size of the buffer required to hold the formatted currency string. In this case, the lpCurrencyStr parameter is not used.
Return Value
Returns the number of characters retrieved in the buffer indicated by lpCurrencyStr if successful. If the cchCurrency parameter is set to 0, the function returns the size of the buffer required to hold the formatted currency 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.
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 call 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 namesGetCurrencyFormatW (Unicode) and GetCurrencyFormatA (ANSI)
See Also
National Language Support
National Language Support Functions
GetCurrencyFormatEx
GetNumberFormat
CURRENCYFMT
Send comments about this topic to Microsoft
Build date: 7/12/2009
==原始网址==http://msdn.microsoft.com/en-us/library/dd318083(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:23:21