Documentation
¶
Overview ¶
Package num2words provides language definitions for number-to-words conversion.
Package num2words implements numbers to words converter.
Index ¶
- func Convert(number int) string
- func ConvertAnd(number int) string
- func ConvertFloat(number float64, precision Precision) string
- func ConvertFloatAnd(number float64, precision Precision) string
- func ConvertLang(number int, lang string) (string, error)
- func ConvertLangAnd(number int, lang string) (string, error)
- type Case
- type Gender
- type NounForms
- type NounSelector
- type Precision
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertAnd ¶
ConvertAnd converts number into the words representation with " and " added between number groups.
func ConvertFloat ¶ added in v1.0.1
ConvertFloat converts float number into words representation. precision controls decimal places (-1 for automatic precision)
func ConvertFloatAnd ¶ added in v1.0.1
ConvertFloatAnd converts float number into words representation with " and " added between number groups. precision controls decimal places (-1 for automatic precision)
func ConvertLang ¶ added in v1.0.3
ConvertLang converts number into words for the specified language
Types ¶
type Case ¶ added in v1.0.3
type Case int
Case represents grammatical case for languages that require it
type Gender ¶ added in v1.0.3
type Gender int
Gender represents grammatical gender for languages that require it
type NounForms ¶ added in v1.0.3
type NounForms struct {
Singular string // Used with 1: "один день"
NominativePlural string // Used with 2-4: "два дні"
GenitivePlural string // Used with 5+: "п'ять днів"
}
NounForms contains different forms of a noun for proper agreement with numbers
type NounSelector ¶ added in v1.0.3
NounSelector is a function that selects the appropriate noun form based on the number and gender context