Format formats values, aligned, in `len(unit) + 10` or fewer characters (except for extremely large numbers). It returns strings representing the numeral and the unit string.
(value Humanable, unit string)
| 96 | // characters (except for extremely large numbers). It returns strings |
| 97 | // representing the numeral and the unit string. |
| 98 | func (h *Humaner) Format(value Humanable, unit string) (numeral string, unitString string) { |
| 99 | n, overflow := value.ToUint64() |
| 100 | if overflow { |
| 101 | return "∞", unit |
| 102 | } |
| 103 | |
| 104 | return h.FormatNumber(n, unit) |
| 105 | } |