Software Development Software Development
Search Engine Optimization Search Engine Optimization
Web site Development Web Development
Presentation / Animation Presentation / Animation
Games Development Games Development
Web Hosting Web Hosting
Templates & Layouts Templates & Layouts
Tutorials Tutorials
  Active Server Pages
  What are Active Server Pages?
  Displaying Date, Time and Text
  Using Variables and Forms
  If...Then and For...Next instructions
  Do...Loop and Select...Case instructions
  Subroutines and Include/virtual
  Session and Application methods
  Dictionary Object
  Cookies
  Open Read and Create files
  Introduction to Global.ASA
  Using ASP and javascript together
  Using Arrays
  Displaying pictures from an ASP file
  ASP Server-Side Scripting Programmer's Reference
  Define ASP?
  ASP Functions
  ASP with Database
  Errors
  Tables
  Include File
  Recordset
  Glossary
  Forms
  ASP FUNCTIONS LIST
  ASP Abs Function
  ASP Array Function
  ASP Atn Function
  ASP Asc Function
  ASP CByte Function
  ASP CBool Function
  ASP CCur Function
  ASP CDbl Function
  ASP CDate Function
  ASP CInt Function
  ASP CLng Function
  ASP CSng Function
  ASP CStr Function
  ASP Cos Function
  ASP Chr Function
  ASP Create Object Function
  ASP Date Function
  ASP DateAdd Function
  ASP DateDiff Function
  ASP DatePart Function
  ASP DateSerial Function
  ASP DateValue Function
  ASP Day Function
  ASP Exp Function
  ASP Filter Function
  ASP Fix Function
  ASP FormatCurrency Function
  ASP FormatDateTime Function
  ASP FormatNumber Function
  ASP FormatPercent Function
  ASP GetObject Function
  ASP Hex Function
  ASP Hour Function
  ASP InStr Function
  ASP InStrRev Function
  ASP Int Function
  ASP IsArray Function
  ASP IsDate Function
  ASP IsEmpty Function
  ASP IsNull Function
  ASP IsObject Function
  ASP IsNumeric Function
  ASP Join Function
  ASP LCase Function
  ASP Left Function
  ASP Len Function
  ASP Log Function
  ASP LTrim Function
  ASP Mid Function
  ASP Minute Function
  ASP Month Function
  ASP MonthName Function
  ASP Now Function
  ASP Oct Function
  ASP Replace Function
  ASP Right Function
  ASP Rnd Function
  ASP Round Function
  ASP RTrim Function
  ASP ScriptEngineBuildVersion Function
  ASP ScriptEngine Function
  ASP ScriptEngineMajorVersion Function
  ASP Second Function
  ASP Sgn Function
  ASP Sin Function
  ASP Space Function
  ASP Split Function
  ASP Sqr Function
  ASP StrComp Function
  ASP String Function
  ASP StrReverse Function
  ASP Time Function
  ASP Tan Function
  ASP TimeSerial Function
  ASP TimeValue Function
  ASP Trim Function
  ASP TypeName Function
  ASP UBound Function
  ASP UCase Function
  ASP VarType Function
  ASP WeekDay Function
  ASP WeekDayName Function
  ASP Year Function
   
  Visual Basic
  Website Designing
  Search Engine Optimization
  SQL
  Photoshop
   
E-mail Sample E-mail Sample
Forums Forums
     
 
FormatPercent Function
Tips >>ASP Functions

WANTS TO MAKE SOFTWARE WITHOUT KNOWLEDGE OF ASP? CLICK HERE

The FormatPercent function returns an expression formatted as a percentage (multiplied by 100) with a trailing % character. Returns an expression formatted as a percentage (multiplied by 100) with a trailing % character.

The Syntax of formatpercent function is :-

FormatPercent(Expression[,NumDigAfterDec[,
IncLeadingDig[,UseParForNegNum[,GroupDig]]]])

Example#1 :-

Code :-
'How many percent is 6 of 345? document.write(FormatPercent(6/345))
Output :-
1.74%

Example#2 :-

Code :-
'How many percent is 6 of 345? document.write(FormatPercent(6/345,1))
Output :-

1.7%


There are Four Mandatory Argument :-

  1. Num Digits After Decimal :- The optional Num Digits After Decimal argument allows you to choose the number of digits after the decimal.

    Example#1 :-


    Code :-
    <% =FormatPercent(.123456789, 4)
    Output :-
    12.3457%


  2. Include Leading Digit :- The optional Include Leading Digit argument includes the leading zero.

    You must only use the constant or value from the Tristate CONSTANTS for this argument.

    CONSTANTVALUEDESCRIPTION
    TristateTrue-1True, will use options
    TristateFalse 0False, will not use options
    TristateUseDefault-2Use default setting

    Example#1 :-

    Code :-
    <% =FormatPercent(.0098, 4, -1) %>
    Output :-
    0.9800%


  3. Use Parens For Negative Numbers :-The optional Use Parens For Negative Number argument replaces a negative sign with parentheses around the number.

    You must only use the constant or value from the Tristate CONSTANTS for this argument.

    CONSTANT VALUEDESCRIPTION
    TristateTrue -1True, will use options
    TristateFalse0False, will not use options
    TristateUseDefault-2Use default setting


    Example#1 :-

    Code :-
    <% =FormatPercent(-.77, 2, 0, -1) %>
    Output :-
    (77.00%)
    E-mail : sales@virtualsplat.com
    Phone : +91-9892413501

    Whatsapp Icon +91-9967648641

    Whatsapp Icon +91-9967648641