Message-ID: <2059542319.8077.1711631469747.JavaMail.web05$@web05> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_8076_693930847.1711631469747" ------=_Part_8076_693930847.1711631469747 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html NumberFormat

NumberFormat

Description

=20

NumberFormat is a helper class= that creates custom number format strings, which are used for formatting n= umbers and dates. Use Style.Num= berFormat to set a number format for a specific style.

=20
C#
=20
 public sealed class NumberFormat
=20
=20
vb.net
=20
Public NotInheritable Class NumberFormat
=20
=20

Examples

=20
C#
=20

          //--- Open a workbook.
          ExcelApplication xla =3D new ExcelApplication();
          Workbook wb =3D xla.Open(@"C:\report.xls");

          //--- Create a style.
          Style percentStyle =3D wb.CreateStyle();

          //--- Specify that the number format for the style is a percentag=
e with three
          //--- decimal places (0.000%).
          //--- The following line is equivalent to percentStyle.NumberForm=
at =3D "0.000%"
          percentStyle.NumberFormat =3D wb.NumberFormat.CreatePercentage(3)=
;
        
=20
=20
vb.net
=20

          '--- Open a workbook.
          Dim xla As New ExcelApplication()
          Dim wb As Workbook =3D xla.Open("C:\report.xls")

          '--- Create a style.
          Dim percentStyle As Style =3D wb.CreateStyle()

          '--- Specify that the number format for the style is a percentage=
 with three
          '--- decimal places (0.000%).
          '--- The following line is equivalent to percentStyle.NumberForma=
t =3D "0.000%"
          percentStyle.NumberFormat =3D wb.NumberFormat.CreatePercentage(3)
        
=20
=20

Methods

=20
=20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 = =20 =20 =20 =20 = =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 = =20 =20

Name

Description

CreateAccounting(Int32, Boolean, NumberFormat.Color)

Creates an accounting format string.

CreateCurrency(Int32, Boolean, Boolean, Boolean, NumberFormat.Color)=

Creates a format string for displaying currency = values.

CreateCurrency(Int32, Boolean, Boolean, NumberFormat.Color, String, = String, Boolean, Boolean)

Creates a format string for displaying currency = values, and allows locale-specific currency symbols.

CreateFraction(Int32)

Creates a string for displaying fractions.

CreateFraction(Int32, Int32)

Creates a string for displaying fractions.

CreateNumber(Int32, Boolean, Boolean, Boolean, Boolean, NumberFormat= .Color)

Creates a format string for displaying numbers.<= /td>=20

CreatePercentage(Int32)

Creates a string for displaying percentages.=20

CreateScientific(Int32)

Creates a scientific number format string.
=20

Nested Classes

=20
=20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20

Name

Description

C= olor

The Col= or enumeration contains the colors that can be used to display neg= ative numbers in a NumberFormat.<= /td>=20

DateFormat

NumberForm= at values for Date data types

Special_EN_US

NumberForm= at values for specialized American numbers

TimeFormat

NumberForm= at values for Time data types
------=_Part_8076_693930847.1711631469747--