LSParseEuroCurrency

Description

Formats a locale-specific currency string that contains the euro symbol (€) or sign (EUR) 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

LSParseEuroCurrency(currency-string) 

See also

LSParseCurrency, LSEuroCurrencyFormat, SetLocale

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. This function determines whether the current locale's country belongs to the Euro Zone, whose members have converted to the euro; if so, it displays the currency value in euros.

Parameters

Parameter Description
currency-string
Locale-specific string or a variable that contains one.

Usage

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

For example ColdFusion code and output that shows differences between earlier ColdFusion releases and ColdFusion MX in accepting input formats and displaying output, see LSEuroCurrencyFormat.

This function is similar to LSParseCurrency, but it parses only euro currency.

For a list of the locale options that ColdFusion supports, see SetLocale.

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

Example

<h3>LSParseEuroCurrency Example</h3>
<p>LSParseEuroCurrency converts locale-specific currency string to 
number. Attempts conversion through each default currency format.
<!--- 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: #LSEuroCurrencyFormat(123456, "local")#<br>
    Currency Number: 
    #LSParseEuroCurrency("EUR123456")#<br>
    International: #LSEuroCurrencyFormat(123456, "international")#<br>
    None: #LSEuroCurrencyFormat(123456, "none")#<br>
    <hr noshade>
  </cfoutput>
</cfloop>

Comments