github.com/mdaxf/iac@v0.0.0-20240519030858-58a061660378/vendor_skip/golang.org/x/text/number/doc.go (about)

     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 formats numbers according to the customs of different locales.
     6  //
     7  // The number formats of this package allow for greater formatting flexibility
     8  // than passing values to message.Printf calls as is. It currently supports the
     9  // builtin Go types and anything that implements the Convert interface
    10  // (currently internal).
    11  //
    12  //	p := message.NewPrinter(language.English)
    13  //
    14  //	p.Printf("%v bottles of beer on the wall.", number.Decimal(1234))
    15  //	// Prints: 1,234 bottles of beer on the wall.
    16  //
    17  //	p.Printf("%v of gophers lose too much fur", number.Percent(0.12))
    18  //	// Prints: 12% of gophers lose too much fur.
    19  //
    20  //	p := message.NewPrinter(language.Dutch)
    21  //
    22  //	p.Printf("There are %v bikes per household.", number.Decimal(1.2))
    23  //	// Prints: Er zijn 1,2 fietsen per huishouden.
    24  //
    25  // The width and scale specified in the formatting directives override the
    26  // configuration of the formatter.
    27  package number