TypstDocumentation

float

A floating-point number.

A limited-precision representation of a real number. Typst uses 64 bits to store floats. Wherever a float is expected, you can also pass an integer.

You can convert a value to a float with this type's constructor.

Example

#3.14 \
#1e4 \
#(10 / 4)
Preview

Constructor
Question mark

Converts a value to a float.

#float(false) \
#float(true) \
#float(4) \
#float(40%) \
#float("2.7") \
#float("1e5")
Preview

value
bool or int or float or ratio or str
RequiredPositional
Question mark

The value that should be converted to a float.