Module

Data.Formatter.Number

Package
purescript-formatters
Repository
purescript-contrib/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

#Formatter Source

newtype Formatter

Constructors

Instances

#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.

#formatOrShowNumber Source