Determines whether a string is a valid representation of a currency amount in the current locale.
True, if the parameter is formatted as a valid currency amount, including the appropriate currency indicator. The return value is True for amounts in the local, international, or none currency formats.
Display and formatting functions, Decision functions, International functions
LSIsCurrency(string
[,locale
])
GetLocale, SetLocale, LSCurrencyFormat
ColdFusion 8: Added the locale parameter.
ColdFusion MX: Changed formatting behavior: this function might return a different result than in earlier releases. This function uses Java standard locale formatting rules on all platforms; the results might vary depending upon the JVM; for example, Sun JVM 1.4.1 requires euro format the local currency if the current locale's country belongs to the Euro Zone.
Parameter |
Description |
---|---|
string |
A currency string or a variable that contains one. |
locale |
Locale to use instead of the locale of the page when processing the function |
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 LSCurrencyFormat.
<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()>