Crate re_format

Crate re_format 

Source
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§

time

Structs§

DurationFormatOptions
Format a duration as e.g. 3.2s or 1h 42m.
FloatFormatOptions
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§

UnsignedAbs

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