Microsoft HomeproductssearchsupportshopWrite Us   Microsoft Home
Magazine
 |  Community
 |  Workshop
 |  Tools & Samples
 |  Training
 |  Site Info

Workshop  |  XML (Extensible Markup Language)

formatNumber Method


Formats the supplied number using the specified format.

Syntax

strValue = oXTLRuntime.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


Does this content meet your programming needs? Write us!

Back to topBack to top

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

 

Magazine Home
Ask Jane
DHTML Dude
Extreme XML
For Starters
More or Hess
Servin' It Up
Site Lights
Web Men Talking
Member Community Home
Benefits: Freebies & Discounts
Benefits: Promote Your Site
Benefits: Connect with Your Peers
Benefits at a Glance
Online Special-Interest Groups
Your Membership
SBN Stores
Join Now
Workshop Home
Essentials
Content & Component Delivery
Component Development
Data Access & Databases
Design
DHTML, HTML & CSS
Extensible Markup Language (XML)
Languages & Development Tools
Messaging & Collaboration
Networking, Protocols & Data Formats
Reusing Browser Technology
Security & Cryptography
Server Technologies
Streaming & Interactive Media
Web Content Management
Workshop Index
Tools & Samples Home
Tools
Samples, Headers, Libs
Images
Sounds
Style Sheets
Web Fonts
Training Home
SBN Live Seminars
SBN Live Chats
Courses
Peer Support
CD-ROM Training
Books & Training Kits
Certification
SBN Home
New to SBN?
What's New on SBN
Site Map
Site Search
Glossary
Write Us
About This Site