Whatever message this page gives is out now! Go check it out!
LSParseNumber(string [, locale])Parameter | Description |
string | A string or a variable that contains one |
locale | Locale to use instead of the locale of the page when processing the function |
<h3>LSParseNumber Example</h3>
<p>LSParseNumber converts a locale-specific string to a number.
Returns the number matching the value of string.
<!--- loop through a list of locales and show number values --->
<cfloop LIST = "#Server.Coldfusion.SupportedLocales#"
index = "locale" delimiters = ",">
<cfset oldlocale = SetLocale(locale)>
<cfoutput><p><B><I>#locale#</I></B><br>
#LSNumberFormat(-1234.5678, "
")#<br>
#LSNumberFormat(-1234.5678, "
.
")#<br>
#LSNumberFormat(1234.5678, "
")#<br>
#LSNumberFormat(1234.5678, "
.
")#<br>
#LSNumberFormat(1234.5678, "$_(
.
)")#<br>
#LSNumberFormat(-1234.5678, "$_(
.
)")#<br>
#LSNumberFormat(1234.5678, "+
.
")#<br>
#LSNumberFormat(1234.5678, "-
.
")#<br>
The actual number:
#LSParseNumber(LSNumberFormat(1234.5678, "
"))#<br>
<hr noshade>
</cfoutput>
</cfloop>