currencies: Currencies representation, pretty printing and conversion

[ bsd3, data, library ] [ Propose Tags ]

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


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0, 0.1.0.1, 0.1.1.0, 0.1.1.1, 0.2.0.0
Dependencies base (>=4.7 && <5), text (>=1.2 && <2) [details]
License BSD-3-Clause
Copyright 2017 Daniel Campoverde
Author Daniel Campoverde
Maintainer alx@sillybytes.net
Category Data
Home page https://github.com/alx741/currencies#readme
Source repo head: git clone https://github.com/alx741/currencies
Uploaded by DanielCampoverde at 2018-06-22T21:21:59Z
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 3803 total (19 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2018-06-22 [all 1 reports]

Readme for currencies-0.2.0.0

[back to package description]

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)
-- "EUR 45,827.35"

prettyPrintWith (defaultConfig { useCurrencySymbol = True }) (Amount USD 2342.2)
-- "$ 2,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) -- Compare to Bitcoin
-- LT