web 2.0

ASP/VBScript FormatPercent()

ASP/VBScript FormatPercent() Returns an expression formatted as a percentage (multiplied by 100) with a trailing % character.

ShotDev Focus:
- Using Asp and FormatPercent() function.

Syntax


<%
FormatPercent(Expression[,NumDigitsAfterDecimal [,IncludeLeadingDigit [,UseParensForNegativeNumbers [,GroupDigits]]]])
%>

Example

asp_formatpercent.asp


<% Option Explicit %>
<html>
<head>
<title>ShotDev.Com Tutorial</title>
</head>
<body>
<%
Response.write FormatPercent("1.2345",3)&"<br>"
Response.write FormatPercent("0.5678",3)&"<br>"
Response.write FormatPercent("12.5678",1)&"<br>"
Response.write FormatPercent("45.5678",2)&"<br>"
Response.write FormatPercent("67.5678",3)&"<br>"
%>
</body>
</html>

Create a asp file and save to path root-path/myasp/

Run
http://localhost/myasp/asp_formatpercent.asp

Screenshot

ASP/VBScript & FormatPercent()

.
.
.
Download this script.
Download

1 Star2 Stars3 Stars4 Stars5 Stars6 Stars7 Stars8 Stars9 Stars10 Stars (No Ratings Yet)
Loading ... Loading ...

Leave a Reply

You must be logged in to post a comment.