decimal package:text-builder

Signed decimal representation of an integer.
>>> decimal 123456
"123456"
>>> decimal (-123456)
"-123456"
>>> decimal 0
"0"
>>> decimal (-2 :: Int8)
"-2"
>>> decimal (-128 :: Int8)
"-128"
Fixed-length decimal without sign. Padded with zeros or trimmed depending on whether it's shorter or longer than specified.
>>> fixedLengthDecimal 5 123
"00123"
>>> fixedLengthDecimal 5 123456
"23456"
>>> fixedLengthDecimal 5 (-123456)
"23456"
>>> fixedLengthDecimal 7 (-123456)
"0123456"
>>> fixedLengthDecimal 0 123
""
>>> fixedLengthDecimal (-2) 123
""
Integer in hexadecimal notation with a fixed number of digits determined by the size of the type.
>>> hexadecimal @Int8 0
"00"
>>> hexadecimal @Int8 4
"04"
>>> hexadecimal @Int8 (-128)
"80"
>>> hexadecimal @Int8 (-1)
"ff"
>>> hexadecimal @Word8 255
"ff"
>>> hexadecimal @Int32 123456
"0001e240"
>>> hexadecimal @Int32 (-123456)
"fffe1dc0"
Same as hexadecimal, but with the "0x" prefix.
>>> prefixedHexadecimal @Int8 0
"0x00"
Decimal representation of an integral value with thousands separated by the specified character.
>>> thousandSeparatedDecimal ',' 1234567890
"1,234,567,890"
>>> thousandSeparatedDecimal ' ' (-1234567890)
"-1 234 567 890"