...
1
2
3
4
5 package number_test
6
7 import (
8 "golang.org/x/text/language"
9 "golang.org/x/text/message"
10 "golang.org/x/text/number"
11 )
12
13 func ExampleMaxIntegerDigits() {
14 const year = 1999
15 p := message.NewPrinter(language.English)
16 p.Println("Year:", number.Decimal(year, number.MaxIntegerDigits(2)))
17
18
19
20 }
21
22 func ExampleIncrementString() {
23 p := message.NewPrinter(language.English)
24
25 p.Println(number.Decimal(1.33, number.IncrementString("0.50")))
26
27
28 }
29
View as plain text