Determines whether a string is formatted as a locale-specific currency string.
True, if the current locale setting is that of a Euro Zone country, and the string is valid in the Euro Zone or non-Euro zone currency format; False, otherwise.
Display and formatting functions, Decision functions, International functions
LSIsCurrency(string)
New in ColdFusion MX: This function might return a different result 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.
Parameter | Description |
---|---|
string |
A currency string or a variable that contains one. |
For examples of ColdFusion code and output that shows differences between earlier ColdFusion releases and ColdFusion MX in accepting input formats and displaying output, see LSEuroCurrencyFormat.
To set the default display format of date, time, number, and currency values, use the SetLocale function.
<h3>LSIsCurrency Example</h3> <cfif IsDefined("FORM.locale")> <!--- if locale is defined, set locale to that entry ---> <cfset NewLocale = SetLocale(FORM.locale)> <p>Is the value "<cfoutput>#FORM.myValue#</cfoutput>" a proper currency value for <cfoutput>#GetLocale()#</cfoutput>? <p>Answer: <cfoutput>#LSIsCurrency(FORM.myValue)#</cfoutput> </cfif> <p><form action = "LSIsCurrency.cfm"> <p>Select a locale for which you would like to check a currency value: <!--- check the current locale for server ---> <cfset serverLocale = GetLocale()>