Click to return to the XML (Extensible Markup Language) home page    
XTLRuntime formatIndex Me...     XTLRuntime formatTime Met...     XTLRuntime Object    
Web Workshop  |  XML (Extensible Markup Language)

formatNumber Method


Formats the supplied number using the specified format.

Syntax

formatNumber(dblNumber, bstrFormat)

Parameters

dblNumber
Double. Number to be formatted.
bstrFormat
String. Specified formatting characteristics to be applied to the number. Zero or more of the following values can be present:
#
Displays only significant digits; does not display insignificant zeros.
0 (zero)
Displays insignificant zeros if a number has fewer digits than there are zeros in the format.
?
Adds spaces for insignificant zeros on either side of the decimal point, so that decimal points align with a fixed-point font. You can also use this symbol for fractions that have varying numbers of digits.
.
Indicates the placement of the decimal point within the format.
,
Displays a comma as a thousands separator or scales a number by a multiple of one thousand.
%
Displays number as a percentage of 100.
E-
(Also "e-") Displays number in scientific format (exponential notation). If a format contains a zero (0) or number sign (#) to the right of an exponent code, displays the number in scientific format and inserts an "E" or "e." The number of zeros or number signs to the right determines the number of digits in the exponent. Place a minus sign by negative exponents.
E+
(Also "e+") Places a minus sign by negative exponents and a plus sign by positive exponents.

Returns

String. Returns a string containing the formatted number.

Applies To

[ Object Name ]
PlatformVersion
Win16:
Win32:
Mac:
Unix:
WinCE:
XTLRuntime


Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.