Class NumberPattern
Specifies a formatting pattern for a number or for a range of values.
Inherited Members
Namespace: Sepia.Globalization.Numbers
Assembly: Sepia.Globalization.dll
Syntax
public class NumberPattern
Examples
ldml simple pattern
<pattern>#,##0.###</pattern>
ldml range of values
<pattern type="1000" count="one">0 thousand</pattern>
<pattern type="1000" count="other">0 thousand</pattern>
<pattern type="10000" count="one">00 thousand</pattern>
Properties
| Improve this Doc View SourceCount
The plural category.
Declaration
public string Count { get; set; }
Property Value
Type | Description |
---|---|
String | Defaults to Empty. |
See Also
| Improve this Doc View SourceFormatString
The string used to format a number.
Declaration
public string FormatString { get; set; }
Property Value
Type | Description |
---|---|
String |
See Also
| Improve this Doc View SourceMinValue
The minimum value for the pattern.
Declaration
public decimal? MinValue { get; set; }
Property Value
Type | Description |
---|---|
Nullable<Decimal> | Defaults to null. |
Methods
| Improve this Doc View SourceAdjust(Decimal)
Adjust the number to the pattern.
Declaration
public decimal Adjust(decimal number)
Parameters
Type | Name | Description |
---|---|---|
Decimal | number | The number to eventually format. |
Returns
Type | Description |
---|---|
Decimal |
Remarks
Adjustments are required when a pattern for a range of values is used.
NumberNeedsAdjusting()
Does a value need adjusting for this pattern.
Declaration
public bool NumberNeedsAdjusting()
Returns
Type | Description |
---|---|
Boolean |
Parse(XPathNavigator)
Create a number pattern from the specified XPathNavigator.
Declaration
public static NumberPattern Parse(XPathNavigator xml)
Parameters
Type | Name | Description |
---|---|---|
XPathNavigator | xml | The XML representation of a number pattern. |
Returns
Type | Description |
---|---|
NumberPattern | A new number pattern, |
Remarks
The xml
must be on a "pattern" element.