Header menu logo Euclid

Format Module

A module with functions for formatting floats with adaptive precision.

Nested modules

Modules Description

ToMaxDigits

Functions and values

Function or value Description

addThousandSeparators thousandSeparator number

Full Usage: addThousandSeparators thousandSeparator number

Parameters:
    thousandSeparator : char
    number : string

Returns: string

Insert thousand separators into a string representing a float or int. Before and after the decimal point. Assumes a string that represent a float or int with '.' as decimal separator and no other input formatting.

thousandSeparator : char
number : string
Returns: string

float x

Full Usage: float x

Parameters:
    x : float

Returns: string

Formatting double precision floating point numbers 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. The global thousand separator, a tick (') is used if more than 3 digits are next to each other before and after the comma. change it at 'Euclid.Format.globalThousandSeparator'

x : float
Returns: string

floatWithSeparator thousandSeparator x

Full Usage: floatWithSeparator thousandSeparator x

Parameters:
    thousandSeparator : char
    x : float

Returns: string

Formatting double precision floating point numbers 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. The thousand separator character is used if more than 3 digits are next to each other before and after the comma. If the separator is the NUL character '\000' no separator will be added.

thousandSeparator : char
x : float
Returns: string

globalThousandSeparator

Full Usage: globalThousandSeparator

Returns: char

The global thousand separator character is used by 'Euclid.Format.float' and 'Euclid.Format.single' if more than 3 digits are next to each other before and after the comma. If the separator is the NUL character '\000' no separator will be added.

Returns: char

iList xs

Full Usage: iList xs

Parameters:
Returns: string
xs : IList<'T>
Returns: string

nl

Full Usage: nl

Returns: string

The newline character for this platform. Just short for System.Environment.NewLine

Returns: string

rarr xs

Full Usage: rarr xs

Parameters:
    xs : ResizeArray<'T>

Returns: string
xs : ResizeArray<'T>
Returns: string

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 built-in absolute tolerance like Rhino3d.

Returns: float

Type something to start searching.