(f, thousand float64, prefixes []string, suffix string)
| 33 | } |
| 34 | |
| 35 | func toDecimalUnitStringImp(f, thousand float64, prefixes []string, suffix string) string { |
| 36 | for i := range prefixes { |
| 37 | if f < 0.9*thousand { |
| 38 | return fmt.Sprintf("%v %v%v", niceNumber(f), prefixes[i], suffix) |
| 39 | } |
| 40 | |
| 41 | f /= thousand |
| 42 | } |
| 43 | |
| 44 | return fmt.Sprintf("%v %v%v", niceNumber(f), prefixes[len(prefixes)-1], suffix) |
| 45 | } |
| 46 | |
| 47 | // BytesStringBase10 formats the given value as bytes with the appropriate base-10 suffix (KB, MB, GB, ...) |
| 48 | func BytesStringBase10[T realNumber](b T) string { |
no test coverage detected