Expand description
Miscellaneous tools to format and parse numbers, durations, etc.
TODO(emilk): move some of this numeric formatting into emath so we can use it in egui_plot.
Modules§
Structs§
- Duration
Format Options - Format a duration as e.g.
3.2sor1h 42m. - Float
Format Options - Options for how to format a floating point number, e.g. an
f64.
Constants§
- MINUS
- The minus character: https://www.compart.com/en/unicode/U+2212
- THIN_
SPACE - A thin space, used for thousands separators, like
1 234:
Traits§
Functions§
- approximate_
large_ number - Pretty format a large number by using SI notation (base 10), e.g.
- format_
bytes - Pretty format a number of bytes by using SI notation (base2), e.g.
- format_
f16 - Format a number with about 5 decimals of precision.
- format_
f32 - Format a number with about 7 decimals of precision.
- format_
f64 - Format a number with about 15 decimals of precision.
- format_
int - Pretty format a signed number by using thousands separators for readability.
- format_
lat_ lon - Format a latitude or longitude value.
- format_
uint - Pretty format an unsigned integer by using thousands separators for readability.
- parse_
bytes - parse_
bytes_ base2 - parse_
bytes_ base10 - parse_
duration - parse_
f64 - Parses a number, ignoring whitespace (e.g. thousand separators),
and treating the special minus character
MINUS(−) as a minus sign. - parse_
i64 - Parses a number, ignoring whitespace (e.g. thousand separators),
and treating the special minus character
MINUS(−) as a minus sign. - remove_
number_ formatting - Remove the custom formatting