Description

FormatFloat produces a formatted number as string based on the following user-specified criteria: * thousands separator * decimal separator * decimal precision

Usage: s := RenderFloat(format, n) The format parameter tells how to render the number n.

See examples: http://play.golang.org/p/LXc1Ddm1lJ

Examples of format strings, given n = 12345.6789: "#,###.##" => "12,345.67" "#,###." => "12,345" "#,###" => "12345,678" "#\u202F###,##" => "12 345,68" "#.###,###### => 12.345,678900 "" (aka default format) => 12,345.67

The highest precision allowed is 9 digits after the decimal symbol. There is also a version for integer number, FormatInteger(), which is convenient for calls within template.

FormatFloat is referenced in 2 repositories

github.com/dustin/go-humanize github.com/apex/apex