-
Notifications
You must be signed in to change notification settings - Fork 5
/
doc_test.go
35 lines (28 loc) · 877 Bytes
/
doc_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package numtow
import (
"fmt"
"github.com/gammban/numtow/lang"
"github.com/gammban/numtow/lang/en"
"github.com/gammban/numtow/lang/ru"
"github.com/gammban/numtow/lang/ru/gender"
)
func ExampleMustString_default() {
fmt.Println(MustString("8691705", lang.EN, en.FormatDefault))
// Output: eight million, six hundred and ninety-one thousand, seven hundred and five
}
func ExampleMustString_without_and() {
fmt.Println(MustString("8691705", lang.EN, en.FormatWithoutAnd))
// Output: eight million six hundred ninety-one thousand seven hundred five
}
func ExampleMustFloat64_default() {
fmt.Println(MustFloat64(1, lang.RU))
// Output: одна
}
func ExampleMustFloat64_female() {
fmt.Println(MustFloat64(2, lang.RU))
// Output: две
}
func ExampleMustFloat64_male() {
fmt.Println(MustFloat64(2, lang.RU, ru.WithFmtGender(gender.Male)))
// Output: два
}