Header menu logo Euclid

Format Module

For formatting floats with adaptive precision.

Functions and values

Function or value Description

float x

Full Usage: float x

Parameters:
    x : float

Returns: string

Formatting with automatic precision. e.g.: 0 digits behind comma if above 1000 if the value is smaller than 'userZeroTolerance' (1e-24) '~0.0' will be shown. if the value is smaller than (1e-7) '≈+0.0' will be shown.

x : float
Returns: string

single x

Full Usage: single x

Parameters:
    x : float32

Returns: string

Formatting with automatic precision. e.g.: 0 digits behind comma if above 1000 if the value is smaller than veryCloseToZero (1e-24) '~0.0' will be shown. if the value is smaller than (1e-6) '≈+0.0' will be shown.

x : float32
Returns: string

thousandSeparator

Full Usage: thousandSeparator

Returns: char

Set this to change the printing of floats larger than 10'000

Returns: char

userZeroTolerance

Full Usage: userZeroTolerance

Returns: float

If the absolut value of a float is below this, display ~0.0 The default is 1e-24 This value can be set for example by hosting apps that have a build in absolute tolerance like Rhino3d.

Returns: float

Type something to start searching.