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

Workshop  |  XML (Extensible Markup Language)

IXTLRuntime::formatNumber Method


Formats the supplied number using the specified format.

Syntax

HRESULT formatNumber(
    double dblNumber,
    BSTR bstrFormat,
    BSTR * pbstrFormattedString);

Parameters

dblNumber
[in] Number to be formatted.
bstrFormat
[in] Formatting characteristics to be applied to the number. Zero or more of the following values can be present:
#
Display only significant digits; do not display insignificant zeros.
0 (zero)
Display insignificant zeros if a number has fewer digits than there are zeros in the format.
?
Add 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.
.
Indicate the placement of the decimal point within the format.
,
Display a comma as a thousands separator or scale a number by a multiple of one thousand.
%
Display number as a percentage of 100.
E-
(Also "e-") Display number in scientific format (exponential notation). If a format contains a zero (0) or number sign (#) to the right of an exponent code, display the number in scientific format and insert 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+") Place a minus sign by negative exponents and a plus sign by positive exponents.
pbstrFormattedString
[out] String containing the formatted number.

Return Value

Returns S_OK if successful, or an error code otherwise.

See Also

IXTLRuntime


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