Back to Devexpress

PdfAcroFormValueFormat.CreateNumberFormat(Int32, PdfAcroFormNumberSeparatorStyle, String, PdfAcroFormCurrencyStyle, PdfAcroFormNegativeNumberStyle) Method

officefileapi-devexpress-dot-pdf-dot-pdfacroformvalueformat-dot-createnumberformat-x28-int32-pdfacroformnumberseparatorstyle-string-pdfacroformcurrencystyle-pdfacroformnegativenumberstyle-x29.md

latest3.6 KB
Original Source

PdfAcroFormValueFormat.CreateNumberFormat(Int32, PdfAcroFormNumberSeparatorStyle, String, PdfAcroFormCurrencyStyle, PdfAcroFormNegativeNumberStyle) Method

Creates a number format for a form field value.

Namespace : DevExpress.Pdf

Assembly : DevExpress.Pdf.v25.2.Core.dll

NuGet Package : DevExpress.Pdf.Core

Declaration

csharp
public static PdfAcroFormValueFormat CreateNumberFormat(
    int decimalPlaces,
    PdfAcroFormNumberSeparatorStyle separatorStyle,
    string currencySymbol,
    PdfAcroFormCurrencyStyle currencyStyle,
    PdfAcroFormNegativeNumberStyle negativeNumberStyle
)
vb
Public Shared Function CreateNumberFormat(
    decimalPlaces As Integer,
    separatorStyle As PdfAcroFormNumberSeparatorStyle,
    currencySymbol As String,
    currencyStyle As PdfAcroFormCurrencyStyle,
    negativeNumberStyle As PdfAcroFormNegativeNumberStyle
) As PdfAcroFormValueFormat

Parameters

NameTypeDescription
decimalPlacesInt32

A number of decimal places.

| | separatorStyle | PdfAcroFormNumberSeparatorStyle |

An enumeration value that indicates the number separator style.

| | currencySymbol | String |

A currency symbol.

| | currencyStyle | PdfAcroFormCurrencyStyle |

An enumeration value that indicates the currency style.

| | negativeNumberStyle | PdfAcroFormNegativeNumberStyle |

An enumeration value that indicates the negative number style.

|

Returns

TypeDescription
PdfAcroFormValueFormat

An object that contains the number format.

|

Remarks

The code sample below shows how to create a text box field with a monetary value:

csharp
//Create a text box with a monetary value:
var numberBox = new PdfAcroFormTextBoxField("number", 1, new PdfRectangle(10, 70, 100, 100));
numberBox.ValueFormat = 
PdfAcroFormValueFormat.CreateNumberFormat(2, PdfAcroFormNumberSeparatorStyle.Dot, "$", PdfAcroFormCurrencyStyle.AfterWithSpace, PdfAcroFormNegativeNumberStyle.None);
numberBox.Text = "264.88 $";
vb
'Create a text box with a monetary value:
Dim numberBox = New PdfAcroFormTextBoxField("number", 1, New PdfRectangle(10, 70, 100, 100))
numberBox.ValueFormat = 
PdfAcroFormValueFormat.CreateNumberFormat(2, PdfAcroFormNumberSeparatorStyle.Dot, "$", PdfAcroFormCurrencyStyle.AfterWithSpace, PdfAcroFormNegativeNumberStyle.None)
numberBox.Text = "264.88 $"

See Also

PdfAcroFormValueFormat Class

PdfAcroFormValueFormat Members

DevExpress.Pdf Namespace