Contents > CFML Reference > ColdFusion Functions > LSParseNumber PreviousNext

LSParseNumber

Converts a string that is a valid numeric representation in the current locale into a formatted number.

A formatted number that matches the value of the string.

International functions, String functions

LSParseNumber(string)

LSParseDateTime, SetLocale

ColdFusion MX:

Changed formatting behavior: this function might return different formatting than in earlier releases. This function uses Java standard locale formatting rules on all platforms.

Parameter

Description

string

A string or a variable that contains one

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

To set the default display format of date, time, number, and currency values, use the SetLocale 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>

Contents > CFML Reference > ColdFusion Functions > LSParseNumber PreviousNext

ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | Bug Reporting

Version 6.1

Comments are no longer accepted for ColdFusion MX 6.1. ColdFusion 8 is the current version.

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functa38.htm