Поделиться через


formatNumber Method (Windows Embedded CE 6.0)

1/6/2010

Formats the number using the specified format.

Script Syntax

            strValue = oXTLRuntime.formatNumber(dblNumber, bstrFormat);

Remarks

Ee502023.collapse(en-US,WinEmbedded.60).gifScript Parameters

  • dblNumber
    Double. Number to be formatted.
  • bstrFormat
    String. Specified formatting characteristics to be applied to the number. See Remarks.

Ee502023.collapse(en-US,WinEmbedded.60).gifScript Return Value

String. Returns a string containing the formatted number.

Ee502023.collapse(en-US,WinEmbedded.60).gifC/C++ Syntax

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

Remarks

Ee502023.collapse(en-US,WinEmbedded.60).gifC/C++ Parameters

  • dblNumber
    [in] Number to be formatted.
  • bstrFormat
    [in] Formatting characteristics to be applied to the number. See Remarks.
  • pbstrFormattedString
    [out, retval] String containing the formatted number.

Ee502023.collapse(en-US,WinEmbedded.60).gifC/C++ Return Values

  • S_OK
    Value returned if successful.

Ee502023.collapse(en-US,WinEmbedded.60).gifRequirements

Header msxml2.h, msxml2.idl
Library uuid.lib
Windows Embedded CE Windows CE .NET 4.0 and later

General Remarks

Specified formatting characteristics that are applied to the number. Zero or more of the following values can be present.

#

Display only significant digits; does 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 a number as a percentage of 100.

E-

(Also "e-") Display a number in scientific format (exponential notation). If a format contains a zero (0) or a number (#) to the right of an exponent code, display 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+") Place a minus (-) by negative exponents and a plus sign by positive exponents.

This method applies to the following interface:

IXTLRuntime.

See Also

Reference

XSLT Methods