Documentation ¶
Overview ¶
Package numtow converts number to words. Supported languages: kazakh, english, russian.
Index ¶
- func Float64(decimal float64, language lang.Lang, options ...interface{}) (words string, err error)
- func Int64(number int64, language lang.Lang, options ...interface{}) (words string, err error)
- func MustFloat64(decimal float64, language lang.Lang, options ...interface{}) string
- func MustInt64(number int64, language lang.Lang, options ...interface{}) string
- func MustString(decimal string, language lang.Lang, options ...interface{}) string
- func String(decimal string, language lang.Lang, options ...interface{}) (words string, err error)
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MustFloat64 ¶
MustFloat64 returns float64 number converted to words or empty string on error.
Example (Default) ¶
fmt.Println(MustFloat64(1, lang.RU))
Output: одна
Example (Female) ¶
fmt.Println(MustFloat64(2, lang.RU))
Output: две
Example (Male) ¶
fmt.Println(MustFloat64(2, lang.RU, ru.WithFmtGender(gender.Male)))
Output: два
func MustString ¶
MustString converts decimal number to words or returns an empty string on error.
Example (Default) ¶
fmt.Println(MustString("8691705", lang.EN, en.FormatDefault))
Output: eight million, six hundred and ninety-one thousand, seven hundred and five
Example (Without_and) ¶
fmt.Println(MustString("8691705", lang.EN, en.FormatWithoutAnd))
Output: eight million six hundred ninety-one thousand seven hundred five
Types ¶
This section is empty.
Directories ¶
Path | Synopsis |
---|---|
Package curtow converts currency to words.
|
Package curtow converts currency to words. |
internal
|
|
en
Package en converts numbers, currencies to english words.
|
Package en converts numbers, currencies to english words. |
kz
Package kz converts numbers, currencies to kazakh words.
|
Package kz converts numbers, currencies to kazakh words. |
ru
Package ru converts numbers, currencies to russian words.
|
Package ru converts numbers, currencies to russian words. |
Click to show internal directories.
Click to hide internal directories.