FormatFlags

Description

[Flags]
enum Tinman.Core.Formatting.FormatFlags

Flags used for formatting numbers (integral and floating-point).

Public / Constants

Default

public constant Default → (0:int32)

The default format number flags.

Digits

public constant Digits → (63:int32)

Specifies the digit count to use for integer values.

When no Exponent is given, the count gives the minimum number of digits to use for formatting. Small values are padded with zeros to the left.

See also

Format.Digits

Digits1

public constant Digits1 → (0:int32)

Specifies the minimum number of digits (1) to use when formatting integer values.

This flag is set by default.

See also

Format.Digits

Digits2

public constant Digits2 → (1:int32)

Specifies the minimum number of digits (2) to use when formatting integer values.

See also

Format.Digits

Digits3

public constant Digits3 → (2:int32)

Specifies the minimum number of digits (3) to use when formatting integer values.

See also

Format.Digits

Digits4

public constant Digits4 → (3:int32)

Specifies the minimum number of digits (4) to use when formatting integer values.

See also

Format.Digits

Digits5

public constant Digits5 → (4:int32)

Specifies the minimum number of digits (5) to use when formatting integer values.

See also

Format.Digits

Digits6

public constant Digits6 → (5:int32)

Specifies the minimum number of digits (6) to use when formatting integer values.

See also

Format.Digits

Digits7

public constant Digits7 → (6:int32)

Specifies the minimum number of digits (7) to use when formatting integer values.

See also

Format.Digits

Digits8

public constant Digits8 → (7:int32)

Specifies the minimum number of digits (8) to use when formatting integer values.

See also

Format.Digits

Digits9

public constant Digits9 → (8:int32)

Specifies the minimum number of digits (9) to use when formatting integer values.

See also

Format.Digits

Digits10

public constant Digits10 → (9:int32)

Specifies the minimum number of digits (10) to use when formatting integer values.

See also

Format.Digits

Digits11

public constant Digits11 → (10:int32)

Specifies the minimum number of digits (11) to use when formatting integer values.

See also

Format.Digits

Digits12

public constant Digits12 → (11:int32)

Specifies the minimum number of digits (12) to use when formatting integer values.

See also

Format.Digits

Digits13

public constant Digits13 → (12:int32)

Specifies the minimum number of digits (13) to use when formatting integer values.

See also

Format.Digits

Digits14

public constant Digits14 → (13:int32)

Specifies the minimum number of digits (14) to use when formatting integer values.

See also

Format.Digits

Digits15

public constant Digits15 → (14:int32)

Specifies the minimum number of digits (15) to use when formatting integer values.

See also

Format.Digits

Digits16

public constant Digits16 → (15:int32)

Specifies the minimum number of digits (16) to use when formatting integer values.

See also

Format.Digits

Digits17

public constant Digits17 → (16:int32)

Specifies the minimum number of digits (17) to use when formatting integer values.

See also

Format.Digits

Digits18

public constant Digits18 → (17:int32)

Specifies the minimum number of digits (18) to use when formatting integer values.

See also

Format.Digits

Digits19

public constant Digits19 → (18:int32)

Specifies the minimum number of digits (19) to use when formatting integer values.

See also

Format.Digits

Digits20

public constant Digits20 → (19:int32)

Specifies the minimum number of digits (20) to use when formatting integer values.

See also

Format.Digits

Precision

public constant Precision → (192:int32)

Bitmask for filtering the floating-point number precision flags.

Precision7

public constant Precision7 → (64:int32)

Floating-point numbers are output using 7 significant decimal digits.

Converting a string that has been output with Precision7 to a 32-bit floating point number will yield the same string when formatted again with the same precision.

Precision9

public constant Precision9 → (192:int32)

Floating-point numbers are output using 9 significant decimal digits.

Formatting a 32-bit floating point number with Precision9 and converting the resulting string back again will yield the same 32-bit floating point number.

Precision15

public constant Precision15 → (0:int32)

Floating-point numbers are output using 15 significant decimal digits.

Converting a string that has been output with Precision15 to a 64-bit floating point number will yield the same string when formatted again with the same precision.

This flag is set by default.

Precision17

public constant Precision17 → (128:int32)

Floating-point numbers are output using 17 significant decimal digits.

Formatting a 32-bit floating point number with Precision17 and converting the resulting string back again will yield the same 64-bit floating point number.

NumberBase

public constant NumberBase → (768:int32)

Bitmask for filtering the number base flags.

NumberBaseDecimal

public constant NumberBaseDecimal → (0:int32)

Format signed integer numbers with the decimal number base.

This flag is set by default.

NumberBaseHexadecimal

public constant NumberBaseHexadecimal → (256:int32)

Format unsigned integer numbers with the hexadecimal number base.

The Exponent flags will be ignored when this flag is set.

NumberBaseOctal

public constant NumberBaseOctal → (512:int32)

Format unsigned integer numbers with the octal number base.

The Exponent flags will be ignored when this flag is set.

Exponent

public constant Exponent → (67107840:int32)

Specifies the decimal exponent to use for formatting integer values.

Formatting an integer 123456 with exponent flags has the following result:

Exponent =   5 : '1.23456E+10'
         =   4 : '1.23456E+9'
         =   3 : '123456000'
         =   2 : '12345600'
         =   1 : '1234560'
         =   0 : '123456'
         =  -1 : '12345.6'
         =  -2 : '1234.56'
         =  -3 : '123.456'
         =  -4 : '12.3456'
         =  -5 : '1.23456'
         =  -6 : '0.123456'
         =  -7 : '0.0123456'
         =  -8 : '1.23456E-3'
         =  -9 : '1.23456E-4'

The non-exponent syntax will be chosen if it is shorter than the exponent syntax. This behaviour can be overridden by specifying a Digits flag: Then the exponent syntax is only considered if the number of output digits is equal to or greater than the given digit count.

See also

Format.Exponent

All

public constant All → (67108863:int32)

All flags.