LSParseNumber

Description

Converts a locale-specific string to a number. Returns the number that matches the value of string.

Category

International functions

Syntax

LSParseNumber(string) 

Parameters

Parameter
Description
string
String to convert to a number

Example

<!--- 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>