LSParseCurrency

Description

Formats a locale-specific currency string as a number. Attempts conversion through each of the default currency formats (none, local, international).

Return value

A formatted number that matches the value of the string.

Category

International functions, String functions

Syntax

LSParseCurrency(string) 

See also

LSCurrencyFormat, LSParseEuroCurrency

History

New in ColdFusion MX: This function might return different formatting than in earlier releases. This function uses Java standard locale formatting rules on all platforms.

Parameters

Parameter Description
string
A locale-specific string a variable that contains one

Usage

This function uses Java standard locale formatting rules on all platforms.

This function is similar to LSParseEuroCurrency, but it parses a non-euro currency string for a locale.

Currency output

The following table shows examples of currency output:

Locale

Format = local
Format =
international

Format = none
Dutch (Belgian)
100.000,00 BF 

BEF100.000,00 

100.000,00 

Dutch (Standard)
fl 100.000,00 

NLG100.000,00 

100.000,00 

English (Australian)
$100,000.00 

AUD100,000.00 

100,000.00 

English (Canadian)
$100,000.00 

CAD100,000.00 

100,000.00 

English (New Zealand)
$100,000.00  

NZD100,000.00 

100,000.00 

English (UK)
£100,000.00 

GBP100,000.00 

100,000.00 

English (US)
$100,000.00 

USD100,000.00 

100,000.00 

French (Belgian)
100.000,00 FB 

BEF100.000,00 

100.000,00 

French (Canadian)
100 000,00 $ 

CAD100 000,00 

100 000,00 

French (Standard)
100 000,00 F 

FRF100 000,00 

100 000,00 

French (Swiss)
SFr. 100'000.00 

CHF100'000.00 

100'000.00 

German (Austrian)
öS 100.000,00 

ATS100.000,00 

100.000,00 

German (Standard)
100.000,00 DM 

DEM100.000,00 

100.000,00 

German (Swiss)
SFr. 100'000.00 

CHF100'000.00 

100'000.00 

Italian (Standard)
L. 10.000.000 

ITL10.000.000 

10.000.000 

Italian (Swiss)
SFr. 100'000.00 

CHF100'000.00 

100'000.00 

Norwegian (Bokmal)
kr 100 000,00 

NOK100 000,00 

100 000,00 

Norwegian (Nynorsk)
kr 100 000,00 

NOK100 000,00 

100 000,00 

Portuguese (Brazilian)
R$100.000,00 

BRC100.000,00 

100.000,00 

Portuguese (Standard)
R$100.000,00 

BRC100.000,00 

100.000,00 

Spanish (Mexican)
$100,000.00 

MXN100,000.00 

100,000.00 

Spanish (Modern)
10.000.000 Pts 

ESP10.000.000 

10.000.000 

Spanish (Standard)
10.000.000 Pts 

ESP10.000.000 

10.000.000 

Swedish
100.000,00 kr 

SEK100.000,00 

100.000,00 

To set the default display format of date, time, number, and currency values, use the SetLocale function.

Example

<h3>LSParseCurrency Example</h3>
<p>LSParseCurrency coverts a locale-specific currency string to a number. 
Attempts conversion through each of the three default currency formats.
<!--- loop through a list of locales; 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: #LSParseCurrency(LSCurrencyFormat(123456,"local"))#<br>
    International: #LSCurrencyFormat(123456, "international")#<br>
    None: #LSCurrencyFormat(123456, "none")#<br>
    <hr noshade>
  </cfoutput>
</cfloop>

Comments