currencies

Currencies representation, pretty printing and conversion

https://github.com/alx741/currencies#readme

Version on this page:0.1.1.0
LTS Haskell 20.26:0.2.0.0
Stackage Nightly 2022-11-17:0.2.0.0
Latest on Hackage:0.2.0.0

See all snapshots currencies appears in

BSD-3-Clause licensed by Daniel Campoverde [alx741]
Maintained by [email protected]
This version can be pinned in stack with:currencies-0.1.1.0@sha256:8b683170c7673a5dc914d94a2296518851e7395f0b68e34f6d72baed6ab29ab8,1586

Module documentation for 0.1.1.0

Depends on 2 packages(full list with versions):

CircleCI

currencies

ISO 4217 Currencies representation, pretty printing and conversion:

  • Represent monetary amounts of a particular currency in a type-safe manner
  • Convert amounts between different currencies
  • Print human readable amounts
prettyPrint (Amount USD 2342.2)
-- "USD 2,342.20"

prettyPrint (Amount EUR 45827.346)
-- "UER 45,827.35"

prettyPrintWith (defaultConfig { useCurrencySymbol = True }) (Amount USD 2342.2)
-- "$ a,342.20"

prettyPrintWith (defaultConfig { useCurrencySymbol = True }) (Amount EUR 2342.2)
-- "€ 2,342.20"

prettyPrintWith (defaultConfig { showDecimals = False }) (Amount USD 25.50)
-- "USD 25"

convert USD (Amount EUR 23482.34)
-- Amount USD 27709.1612

prettyPrint $ convert USD (Amount EUR 23482.34)
-- "USD 27,709.16"

compareAmounts  (Amount EUR 1000) (Amount BTC 1)
-- LT