currencies: Currencies representation, pretty printing and conversion

[ bsd3, data, library ] [ Propose Tags ]

ISO 4217 Currencies representation, pretty printing and conversion:


[Skip to Readme]
Versions 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 Fri Jun 22 21:21:59 UTC 2018
Distributions LTSHaskell:0.2.0.0, NixOS:0.2.0.0, Stackage:0.2.0.0
Downloads 1038 total (31 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2018-06-22 [all 1 reports]
Hackage Matrix CI

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


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