Converts a locale-specific currency string to a number. Attempts conversion through each of the default currency formats (none, local, international). Returns the number matching the value of string.
LSParseCurrency(string)
LSCurrencyFormat,
LSParseEuroCurrency
Parameter |
Description |
---|---|
string |
The locale-specific string to convert to a number |
The following table shows sample currency output for some locales supported by ColdFusion in each of the format types: local
, international
, and none
.
<!--- This example shows LSParseCurrency ---> <html> <head> <title>LSParseCurrency Example</title> </head> <body> <H3>LSParseCurrency Example</H3> <P>LSParseCurrency coverts a local-specific currency string to a number. Attempts conversion through each of the three default currency formats. <!--- loop through a list of locales and show currency values for 123,456 units ---> <CFLOOP LIST = "#Server.Coldfusion.SupportedLocales#" INDEX = "locale" DELIMITERS = ","> <cfset oldlocale = SetLocale(locale)> <cfoutput><P><B><I>#locale#</I></B><BR> Local: #LSCurrencyFormat(123456, "local")#<BR> Currency Number: #LSParseCurrency(LSCurrencyFormat(123456,"local"))#<BR> International: #LSCurrencyFormat(123456, "international")#<BR> None: #LSCurrencyFormat(123456, "none")#<BR> <Hr noshade> </cfoutput> </CFLOOP> </body> </html>