| 1 | // Copyright 2017 The Go Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style |
| 3 | // license that can be found in the LICENSE file. |
| 4 | |
| 5 | package number_testscip-go gomod golang.org/x/text . `golang.org/x/text/number_test`/ |
| 6 | |
| 7 | import ( |
| 8 | "golang.org/x/text/languagescip-go gomod golang.org/x/text . `golang.org/x/text/language`/" |
| 9 | "golang.org/x/text/messagescip-go gomod golang.org/x/text . `golang.org/x/text/message`/" |
| 10 | "golang.org/x/text/numberscip-go gomod golang.org/x/text . `golang.org/x/text/number`/" |
| 11 | ) |
| 12 | |
| 13 | func ExampleMaxIntegerDigitsscip-go gomod golang.org/x/text . `golang.org/x/text/number_test`/ExampleMaxIntegerDigits().() { |
| 14 | const year = 1999 |
| 15 | p := messagescip-go gomod golang.org/x/text . `golang.org/x/text/message`/.NewPrinterscip-go gomod golang.org/x/text . `golang.org/x/text/message`/NewPrinter().(languagescip-go gomod golang.org/x/text . `golang.org/x/text/language`/.Englishscip-go gomod golang.org/x/text . `golang.org/x/text/language`/English.) |
| 16 | p.Printlnscip-go gomod golang.org/x/text . `golang.org/x/text/message`/Printer#Println().("Year:", numberscip-go gomod golang.org/x/text . `golang.org/x/text/number`/.Decimalscip-go gomod golang.org/x/text . `golang.org/x/text/number`/Decimal().(year, numberscip-go gomod golang.org/x/text . `golang.org/x/text/number`/.MaxIntegerDigitsscip-go gomod golang.org/x/text . `golang.org/x/text/number`/MaxIntegerDigits().(2))) |
| 17 | |
| 18 | // Output: |
| 19 | // Year: 99 |
| 20 | } |
| 21 | |
| 22 | func ExampleIncrementStringscip-go gomod golang.org/x/text . `golang.org/x/text/number_test`/ExampleIncrementString().() { |
| 23 | p := messagescip-go gomod golang.org/x/text . `golang.org/x/text/message`/.NewPrinterscip-go gomod golang.org/x/text . `golang.org/x/text/message`/NewPrinter().(languagescip-go gomod golang.org/x/text . `golang.org/x/text/language`/.Englishscip-go gomod golang.org/x/text . `golang.org/x/text/language`/English.) |
| 24 | |
| 25 | p.Printlnscip-go gomod golang.org/x/text . `golang.org/x/text/message`/Printer#Println().(numberscip-go gomod golang.org/x/text . `golang.org/x/text/number`/.Decimalscip-go gomod golang.org/x/text . `golang.org/x/text/number`/Decimal().(1.33, numberscip-go gomod golang.org/x/text . `golang.org/x/text/number`/.IncrementStringscip-go gomod golang.org/x/text . `golang.org/x/text/number`/IncrementString().("0.50"))) |
| 26 | |
| 27 | // Output: 1.50 |
| 28 | } |