jxpath

package
v1.5.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 6, 2022 License: MIT Imports: 10 Imported by: 0

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

func FormatTime(t time.Time, picture string) (string, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL