August 2001
Intermediate to advanced
976 pages
38h 8m
English
LSNumberFormat
LSNumberFormat(number[,mask])
Returns number formatted according to
mask using the locale convention. If no
value is specified for mask,
LSNumberFormat( ) returns
number as an integer. Valid entries for
mask are the same as for
NumberFormat( ). The following example applies the
function to various numbers for each locale:
<CFLOOP INDEX="locale" LIST="#Server.Coldfusion.SupportedLocales#">
<CFSET temp = SetLocale(locale)>
<CFOUTPUT>
<P><B>#locale#</B><BR>
LSNumberFormat(1000.99, '____'): #LSNumberFormat(1000.99, '____')#<BR>
LSNumberFormat(1000.99, '9999.99'): #LSNumberFormat(1000.99, '9999.99')#<BR>
LSNumberFormat(1000.99, '09999.9900'):
#LSNumberFormat(1000.99, '09999.9900')#<BR>
LSNumberFormat(-1000.99, '(9999.99)'):
#LSNumberFormat(-1000.99, '(9999.99)')#<BR>
LSNumberFormat(1000.99, '+9999.99'):
#LSNumberFormat(1000.99, '+9999.99')#<BR>
LSNumberFormat(-1000.99, '+9999.99'):
#LSNumberFormat(-1000.99, '+9999.99')#<BR>
LSNumberFormat(1000.99, '-9999.99'):
#LSNumberFormat(1000.99, '-9999.99')#<BR>
LSNumberFormat(-1000.99, '-9999.99'):
#LSNumberFormat(-1000.99, '-9999.99')#<BR>
LSNumberFormat(1000.99, '$9,999.99'):
#LSNumberFormat(1000.99, '$9,999.99')#<BR>
LSNumberFormat(1000.99, 'L999,999.99'):
#LSNumberFormat(1000.99, 'L999,999.99')#<BR>
LSNumberFormat(1000.99, 'C999,999.99'):
#LSNumberFormat(1000.99, 'C999,999.99')#<BR>
LSNumberFormat(1000.99, 'C_____(^___)'):
#LSNumberFormat(1000.99, 'C_____(^___)')#<BR>
</CFOUTPUT>
</CFLOOP>Read now
Unlock full access