The currencies package

[ Tags: bsd3, data, library ] [ Propose Tags ]

ISO 4217 Currencies representation, pretty printing and conversion:


[Skip to Readme]

Properties

Versions 0.1.0.0, 0.1.0.1, 0.1.1.0, 0.1.1.1
Dependencies base (>=4.7 && <5), text (>=1.2 && <2) [details]
License BSD3
Copyright 2017 Daniel Campoverde
Author Daniel Campoverde
Maintainer alx@sillybytes.net
Category Data
Home page https://github.com/alx741/currencies#readme
Source repository head: git clone https://github.com/alx741/currencies
Uploaded Tue Oct 17 23:36:35 UTC 2017 by DanielCampoverde
Distributions NixOS:0.1.1.1, Stackage:0.1.1.1
Downloads 183 total (34 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 2017-10-17 [all 1 reports]
Hackage Matrix CI

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for currencies-0.1.1.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)
-- "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