Module repr

Source
Expand description

Debug representation of values.

Constants§

MINUS_SIGN
The Unicode minus sign.

Traits§

Repr
A trait that defines the repr of a Typst value.

Functions§

display_float
Converts a float to a string that can be used to display the float as text.
format_float
Converts a float to a string representation with a specific precision and a unit, all with a single allocation.
format_float_component
Converts a float to a string representation with a precision of three decimal places. This is intended to be used as part of a larger structure containing multiple float components, such as colors.
format_float_with_unit
Converts a float to a string representation with a precision of two decimal places, followed by a unit.
format_int_with_base
Format an integer in a base.
pretty_array_like
Formats an array-like construct.
pretty_comma_list
Formats a comma-separated list.
repr
Returns the string representation of a value.
separated_list
Formats pieces separated with commas and a final “and” or “or”.