FormatNumber Functions

Abs Function,Array Function,Asc Function,Atn Function,CBool Function,CByte Function,CCur Function,CDate Function,CDbl Function,Chr Function,CInt Function,CLng Function,Cos Function,CreateObject Function,CSng Function,CStr Function,Date Function,DateAdd Function,DateDiff Function,DatePart Function,DateSerial Function,DateValue Function,Day Function,Eval Function,Exp Function,Filter Function,Fix Function,FormatCurrency Function,FormatDateTime Function,FormatNumber Function,FormatPercent Function,GetLocale Function,GetObject Function,GetRef Function,Hex Function,Hour Function,InputBox Function,InStr Function,InStrRev Function,Int Function,IsArray Function,IsDate Function,IsEmpty Function,IsNull Function,IsNumeric Function,IsObject Function,Join Function,LBound Function,LCase Function,Left Function,Len Function,LoadPicture Function,Log Function,LTrim Function,Mid Function,Minute Function,Month Function,MonthName Function,MsgBox Function,Now Function,Oct Function,Replace Function,RGB Function,Right Function,Rnd Function,Round Function,RTrim Function,ScriptEngine Function,ScriptEngineBuildVersion Function,ScriptEngineMajorVersion Function,ScriptEngineMinorVersion Function,Second Function,Sgn Function,Sin Function,Space Function,Split Function,Sqr Function,StrComp Function,String Function,StrReverse Function,Tan Function,Time Function,Timer Function,TimeSerial Function,TimeValue Function,Trim Function,TypeName Function,UBound Function,UCase Function,VarType Function,Weekday Function,WeekdayName Function,Year Function Home home | Other Resources other resources | Advertise with us advertise | Link to us link to us | Contact us contact | Bookmark Us!
Google
 
Where can I find good Windows Web Hosting to host my VBScript Site?
You can find good Windows Hosting which support VBScript, ASP, ASP.Net,VisualStudio.Net and MSSQL at a very reasonable low monthly fee at EasyCGI.com and DiscountASP.Net

FormatNumber Function

Returns an expression formatted as a number.

FormatNumber(Expression [,NumDigitsAfterDecimal [,IncludeLeadingDigit [,UseParensForNegativeNumbers [,GroupDigits]]]])

Arguments

Expression

Required. Expression to be formatted.

NumDigitsAfterDecimal

Optional. Numeric value indicating how many places to the right of the decimal are displayed. Default value is -1, which indicates that the computer's regional settings are used.

IncludeLeadingDigit

Optional. Tristate constant that indicates whether or not a leading zero is displayed for fractional values. See Settings section for values.

UseParensForNegativeNumbers

Optional. Tristate constant that indicates whether or not to place negative values within parentheses. See Settings section for values.

GroupDigits

Optional. Tristate constant that indicates whether or not numbers are grouped using the group delimiter specified in the control panel. See Settings section for values.

Settings

The IncludeLeadingDigit, UseParensForNegativeNumbers, and GroupDigits arguments have the following settings:

ConstantValueDescription
TristateTrue-1True
TristateFalse0False
TristateUseDefault-2Use the setting from the computer's regional settings.

Remarks

When one or more of the optional arguments are omitted, the values for omitted arguments are provided by the computer's regional settings.

Note   All settings information comes from the Regional Settings Number tab.

The following example uses the FormatNumber function to format a number to have four decimal places:

Function FormatNumberDemo
   Dim MyAngle, MySecant, MyNumber
   MyAngle = 1.3   ' Define angle in radians.
   MySecant = 1 / Cos(MyAngle)   ' Calculate secant.
   FormatNumberDemo = FormatNumber(MySecant,4) ' Format MySecant to four decimal places.
End Function

VBScriptOnline.com - Abs Function,Array Function,Asc Function,Atn Function,CBool Function,CByte Function,CCur Function,CDate Function,CDbl Function,Chr Function,CInt Function,CLng Function,Cos Function,CreateObject Function,CSng Function,CStr Function,Date Function,DateAdd Function,DateDiff Function,DatePart Function,DateSerial Function,DateValue Function,Day Function,Eval Function,Exp Function,Filter Function,Fix Function,FormatCurrency Function,FormatDateTime Function,FormatNumber Function,FormatPercent Function,GetLocale Function,GetObject Function,GetRef Function,Hex Function,Hour Function,InputBox Function,InStr Function,InStrRev Function,Int Function,IsArray Function,IsDate Function,IsEmpty Function,IsNull Function,IsNumeric Function,IsObject Function,Join Function,LBound Function,LCase Function,Left Function,Len Function,LoadPicture Function,Log Function,LTrim Function,Mid Function,Minute Function,Month Function,MonthName Function,MsgBox Function,Now Function,Oct Function,Replace Function,RGB Function,Right Function,Rnd Function,Round Function,RTrim Function,ScriptEngine Function,ScriptEngineBuildVersion Function,ScriptEngineMajorVersion Function,ScriptEngineMinorVersion Function,Second Function,Sgn Function,Sin Function,Space Function,Split Function,Sqr Function,StrComp Function,String Function,StrReverse Function,Tan Function,Time Function,Timer Function,TimeSerial Function,TimeValue Function,Trim Function,TypeName Function,UBound Function,UCase Function,VarType Function,Weekday Function,WeekdayName Function,Year Function