Code Monkey home page Code Monkey logo

currency-json's Introduction

#Currencies

A JSON List of Currency Formats & Information

What It Contains

"JPY": {
    "name": "Japanese Yen",
    "iso": {
        "code": "JPY",
        "num": 392
    }
    "symbol": {
        "default": {
            "display": "¥",
            "code": "¥"
        },
        "native": {
            "display": "",
            "code": "円"
        }
    },
    "units": {
        "decimal": 0,
        "sub": 0,
        "name": {
            "major": "Yen",
            "minor": null
        }
    },
    "format": "-###,###,###"
}

name

The name of the currency

iso.code

The three-letter ISO-4217 currency code

iso.num

The three-digit ISO-4217 numeric currency code

symbol.default.display

The default symbol, used globally, for this currency

symbol.default.code

HTML Hex value for this symbol

symbol.native

If a currency is displayed differently natively (eg. A different symbol for Yen is commonly used in Japan), an object will be returned. Otherwise null

symbol.native.display

The native display symbol, used in local territories, for this currency

symbol.native.code

HTML Hex value for this symbol

units.decimal

Number of decimal units used in the currency

units.sub

Number of sub-units used in the currency. eg: 100 Pence GBP = 1 Pound GBP

units.name.major

The name for the major unit. eg. GBP: Pound

units.name.minor

The name for the minor unit eg. GBP: Pence

format

A DecimalFormat style string for displaying positive and negative currency amounts, with symbols (see below for a gist that works with these)

Formatting String

The format value can be used to display the currency in a format familiar to local users. For example, GBP uses decimal points to indicate decimals, where EUR uses commas.

The location of negative value indicators also changes dependent on currency.

The following gist will format a number using the format string supplied in the JSON: https://gist.github.com/benhodgson87/becf5884a53d90f86b6e

Contribute

If a currency is missing, or you've noticed some mistakes, please submit a pull request. Any help keeping this as complete and up-to-date as possible is greatly appreciated.

Please ensure when submitting a PR that you stick to the existing formatting (4-space tabs, etc.)

currency-json's People

Contributors

benhodgson87 avatar mgmcintyre avatar wiredmax avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.