From d5e1f7e2982c2fcc888ccac550b34095efbee217 Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Fri, 18 May 2018 07:32:31 -0700 Subject: Upgrading server dependency. (#8807) --- vendor/github.com/dustin/go-humanize/comma.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'vendor/github.com/dustin/go-humanize/comma.go') diff --git a/vendor/github.com/dustin/go-humanize/comma.go b/vendor/github.com/dustin/go-humanize/comma.go index 13611aaab..520ae3e57 100644 --- a/vendor/github.com/dustin/go-humanize/comma.go +++ b/vendor/github.com/dustin/go-humanize/comma.go @@ -76,6 +76,14 @@ func Commaf(v float64) string { return buf.String() } +// CommafWithDigits works like the Commaf but limits the resulting +// string to the given number of decimal places. +// +// e.g. CommafWithDigits(834142.32, 1) -> 834,142.3 +func CommafWithDigits(f float64, decimals int) string { + return stripTrailingDigits(Commaf(f), decimals) +} + // BigComma produces a string form of the given big.Int in base 10 // with commas after every three orders of magnitude. func BigComma(b *big.Int) string { -- cgit v1.2.3-1-g7c22