Hledger.Data.Currency

hledger-lib-1.41: A library providing the core functionality of hledger

Safe Haskell | Safe-Inferred
Language | Haskell2010

Hledger.Data.Currency

Description

Currency names, symbols and codes. Reference: - https://www.xe.com/symbols - https://www.xe.com/currency

Synopsis

- currencies :: [([Char], CurrencyCode, CurrencySymbol)]
- currencySymbolToCode :: CurrencySymbol -> Maybe CurrencyCode
- currencyCodeToSymbol :: CurrencyCode -> Maybe CurrencySymbol

# Documentation

currencies :: [([Char], CurrencyCode, CurrencySymbol)] #

currencySymbolToCode :: CurrencySymbol -> Maybe CurrencyCode #

Look for a ISO 4217 currency code corresponding to this currency symbol.

    >>> currencySymbolToCode ""
    Nothing
    >>> currencySymbolToCode "$"
    Just "USD"

currencyCodeToSymbol :: CurrencyCode -> Maybe CurrencySymbol #

Look for a currency symbol corresponding to this ISO 4217 currency code.

    >>> currencyCodeToSymbol "CZK"  -- Just "Kč"
    Just "K\269"