Wrapper element for Intl.NumberFormat

[ This description is mirrored from README.md at github.com/t2ym/i18n-number on 2019-05-22 ]

Build Status Coverage Status npm version Published on webcomponents.org

i18n-number

Wrapper element for Intl.NumberFormat.

Demo and API Docs

Install

    npm install i18n-number

Import

    import "i18n-number/i18n-number.js";

Usage

    <i18n-number 
      lang="en"
      options='{ "style": "currency", "currency": "USD" }' 
      >123456.78</i18n-number>

This renders as follows:

    $123,456.78

Demo

Prerequisite for Building and Serving Demo

    npm install -g polymer-cli

On-the-fly Build

    # Serve at http://localhost:8080/components/i18n-number/demo/
    polymer serve --npm --module-resolution=node -p 8080

Static Builds

  • Build
    polymer build
  • Targets
target browser minify bundled
build/esm-unbundled es6,modules no no
build/esm-bundled es6,modules yes yes
build/es6-bundled es6 yes yes
build/es5-bundled es5 yes yes
  • Serve
    # Serve at http://localhost:8080/
    cd build/{esm-unbundled|esm-bundled|es6-bundled|es5-bundled}
    python -m SimpleHTTPServer 8080 # or any HTTP(S) server

License

BSD-2-Clause

Install

Link to this version
ImportedReleased 17 January 2019Other
Framework Support
Polymer 3.0+
Also supported:
Polymer 1 (1.0.2)Polymer 2 (2.0.2)
Browser Independent
Install with
npm install i18n-number"@3.0.1"
Run the above npm command in your project folder. If you have any issues installing, please contact the author.
Release notes - Version 3.0.1

Dependencies