Initializes a new instance of the DoubleFormat class.

Namespace: Dapfor.Net.Formats
Assembly: Dapfor.Net (in Dapfor.Net.dll) Version: 2.10.3.24917 (2.10.3.24917)

Syntax

C#
public DoubleFormat(
	int precision,
	bool shortForm,
	bool showZero,
	IFormatProvider formatProvider
)
Visual Basic
Public Sub New ( 
	precision As Integer,
	shortForm As Boolean,
	showZero As Boolean,
	formatProvider As IFormatProvider
)
Visual C++
public:
DoubleFormat(
	int precision, 
	bool shortForm, 
	bool showZero, 
	IFormatProvider^ formatProvider
)
F#
new : 
        precision : int * 
        shortForm : bool * 
        showZero : bool * 
        formatProvider : IFormatProvider -> DoubleFormat

Parameters

precision
Type: System..::..Int32
The precision.
shortForm
Type: System..::..Boolean
if set to true the values will be shown in the short form.
showZero
Type: System..::..Boolean
if set to true, the DoubleFormat will show '0' symbol for the zero values.
formatProvider
Type: System..::..IFormatProvider
The format provider.

Examples

 Copy imageCopy
void DoubleFormat()
{
    IFormat format = new DoubleFormat(4, true, true, CultureInfo.InvariantCulture);
    UnboundValueAccessor accessor = new UnboundValueAccessor();

    accessor["Price"].Value = 123456789.123456;
    Console.WriteLine(format.Format(accessor["Price"]));
}

//Console output:
123.4568 M

See Also