Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatNumber ¶
func FormatNumber(value float64, picture string, format DecimalFormat) (string, error)
FormatNumber converts a number to a string, formatted according to the given picture string and decimal format.
See the XPath function format-number for the syntax of the picture string.
https://www.w3.org/TR/xpath-functions-31/#formatting-numbers
func FormatTime ¶
FormatTime converts a time to a string, formatted according to the given picture string.
See the XPath documentation for the syntax of the picture string.
https://www.w3.org/TR/xpath-functions-31/#rules-for-datetime-formatting
Types ¶
type DecimalFormat ¶
type DecimalFormat struct { DecimalSeparator rune GroupSeparator rune ExponentSeparator rune MinusSign rune Infinity string NaN string Percent string PerMille string ZeroDigit rune OptionalDigit rune PatternSeparator rune }
A DecimalFormat defines the symbols used in a FormatNumber picture string.
See the XPath documentation for background.
https://www.w3.org/TR/xpath-functions-31/#defining-decimal-format
func NewDecimalFormat ¶
func NewDecimalFormat() DecimalFormat
NewDecimalFormat returns a new DecimalFormat object with the default number formatting settings.