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

Safe Haskell | None
Language | GHC2021

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)] Source #

currencySymbolToCode :: CurrencySymbol -> Maybe CurrencyCode Source #

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

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

currencyCodeToSymbol :: CurrencyCode -> Maybe CurrencySymbol Source #

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

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