Show / Hide Table of Contents

Class NumberPattern

Specifies a formatting pattern for a number or for a range of values.

Inheritance
Object
NumberPattern
Inherited Members
Object.ToString()
Object.Equals(Object)
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
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 Source

Count

The plural category.

Declaration
public string Count { get; set; }
Property Value
Type Description
String

Defaults to Empty.

See Also
Plural
| Improve this Doc View Source

FormatString

The string used to format a number.

Declaration
public string FormatString { get; set; }
Property Value
Type Description
String
See Also
http://www.unicode.org/reports/tr35/tr35-33/tr35-numbers.html#Number_Patterns
| Improve this Doc View Source

MinValue

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 Source

Adjust(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.

| Improve this Doc View Source

NumberNeedsAdjusting()

Does a value need adjusting for this pattern.

Declaration
public bool NumberNeedsAdjusting()
Returns
Type Description
Boolean
| Improve this Doc View Source

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.

  • Improve this Doc
  • View Source
Back to top Generated by DocFX