Converts a locale-specific string to a number. Returns the number that matches the value of string.
LSParseNumber(string)
Parameter |
Description |
---|---|
string |
String to convert to a number |
<!--- This shows LSParseNumber ---> <html> <head> <title>LSParseNumber Example</title> </head> <body> <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> </body> </html>