package compactnumber

Import Path
	github.com/nkall/compactnumber (on go.dev)

Dependency Relation
	imports 8 packages, and imported by one package

Involved Source Files Package compactnumber allows for localized CLDR compact number formatting. Code generated by https://github.com/nkall/compactnumber at 2019-10-20 13:43:16.072781 -0700 PDT m=+0.107571706. DO NOT EDIT. Based on https://github.com/unicode-cldr/cldr-numbers-modern version 36 Do not edit this file manually! Instead, follow the "Generating Compact Forms" guide in the README. models.go
Package-Level Type Names (total 3)
/* sort by: | */
CompactType is an enum used to specify compaction settings. func NewFormatter(lang string, compactType CompactType) Formatter const Long const None const Short
Formatter is a struct containing a method to format an integer based on the specified language and compaction type. Format takes in an integer and options and formats it according to the formatter's locale and compaction settings. Note: this method truncates numbers and does not support fractions (e.g. 11.5M). Documented in CLDR spec: http://www.unicode.org/reports/tr35/tr35-numbers.html#Compact_Number_Formats *Formatter : FormatterAPI func NewFormatter(lang string, compactType CompactType) Formatter
FormatterAPI is an interface implemented by Formatter that can be used for mocking purposes ( FormatterAPI) Format(n int, numOptions ...number.Option) (string, error) *Formatter
Package-Level Functions (only one)
NewFormatter creates a new formatter based on the specified language and compaction type.
Package-Level Constants (total 3)
Long-form compaction, e.g. 17 million.
No compaction, e.g. 17,000,000.
Short-form compaction, e.g. 17M.