programming-examples/asp/FilesMaths/Format Numbers.asp
2019-11-18 14:25:58 +01:00

34 lines
1.2 KiB
Plaintext

<html><head>
<TITLE>formatnumbers2.asp</TITLE>
</head><body bgcolor="#FFFFFF">
<%
' My ASP formatting number sample
mynumber=123.4567
Response.Write "<hr>" & mynumber & "<br>"
Response.Write "formatnumber(mynumber,0)" & "<br>"
Response.Write FormatNumber(mynumber,0) & "<hr>"
Response.Write "formatnumber(mynumber,2)" & "<br>"
Response.Write FormatNumber(mynumber,2) & "<hr>"
Response.Write "formatnumber(mynumber,6)" & "<br>"
Response.Write FormatNumber(mynumber,6) & "<hr>"
mynumber=.4567
Response.Write mynumber & "<br>"
'0 means means no leading zeroes
Response.Write "formatnumber(mynumber,2,0)" & "<br>"
Response.Write FormatNumber(mynumber,2,0) & "<hr>"
'1 means means pad with leading zeroes
'response.write "formatnumber(mynumber,2,1)" & "<br>"
'response.write formatnumber(mynumber,2,1) & "<hr>"
'mynumber=-123.4567
'response.write mynumber & "<br>"
'0 means means no parentheses for negative numbers
'response.write "formatnumber(mynumber,2,0,0)" & "<br>"
'response.write formatnumber(mynumber,2,0,0) & "<hr>"
'1 means means yes parentheses for negative numbers
'response.write "formatnumber(mynumber,2,0,1)" & "<br>"
'response.write formatnumber(mynumber,2,0,1) & "<hr>"
%>
</body></html>