Module
Data.Decimal
- Package
- purescript-decimals
- Repository
- sharkdp/purescript-decimals
This module defines a Decimal
data type for arbitrary precision numbers.
#fromString Source
fromString :: String -> Maybe Decimal
Parse a string into a Decimal
, assuming a decimal representation. Returns
Nothing
if the parse fails.
Examples:
fromString "42.001"
fromString "857981209301293808359384092830482"
fromString "1e100"
fromString "0.12301928309128183579487598149533"
#fromNumber Source
fromNumber :: Number -> Decimal
Convert a number to a Decimal.
#toPrecision Source
toPrecision :: Int -> Decimal -> String
A representation of the Decimal
as a String
, rounded to the given
number of significant digits
- Modules
- Data.
Decimal