currencies: Currencies representation, pretty printing and conversion

[ bsd3, data, library ] [ Propose Tags ]

ISO 4217 Currencies representation, pretty printing and conversion:


[Skip to Readme]
Versions [faq] 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 [alx741]
Author Daniel Campoverde [alx741]
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 alx741 at Sun Aug 20 01:11:59 UTC 2017
Distributions LTSHaskell:0.2.0.0, NixOS:0.2.0.0, Stackage:0.2.0.0
Downloads 1951 total (129 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs available [build log]
Last success reported on 2017-08-20 [all 1 reports]

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for currencies-0.1.0.1

[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)
-- "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