Data.Formatter.Number
- Package
- formatters
- Repository
- id3as/purescript-formatters
This module has no support of percents and currencies.
Please, note that using simple formatter that tabulates number with
zeros and put commas between thousands should be enough for everything
because one could just compose it with flip append "%"
or whatever
#printFormatter Source
printFormatter :: Formatter -> String
#format Source
format :: Formatter -> Number -> String
Formats a number according to the format object provided.
Due to the nature of floating point numbers, may yield unpredictable results for extremely
large or extremely small numbers, such as numbers whose absolute values are ≥ 1e21 or ≤ 1e-21,
or when formatting with > 20 digits after the decimal place.
See purescript-decimals
for working with arbitrary precision decimals, which supports simple number
formatting for numbers that go beyond the precision available with Number
.
#showNumberAsFloat Source
showNumberAsFloat :: Number -> String