You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP
Socket
Sign inDemoInstall
Socket

ember-cli-numeral

Package Overview
Dependencies
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-cli-numeral

ES6 accessible module for Numeral.js within your Ember applications.

1.0.0
latest
Source
npm
Version published
Weekly downloads
1.6K
-8.59%
Maintainers
2
Weekly downloads
 
Created
Source

ember-cli-numeral

Build Status Ember Observer Score NPM Version Ember badge

ES6 accessible module for Numeral.js within your Ember applications.

Install

ember install ember-cli-numeral

Usage

import numeral from 'numeral';

let string = numeral(1000).format('0,0');
// '1,000'

See the Numeral.js docs for general usage.

Including Numeral.js locales

To include all the Numeral.js locales definitions, you need to add the following configuration to your ember-cli-build.js.

let app = new EmberApp(defaults, {
  numeral: {
    includeLocales: ['en-gb', 'pl']
  }
});

Then import locales to register them, and activate them:

import numeral from 'numeral';
import 'numeral/en-gb';
import 'numeral/pl';

let string = numeral.locale('pl') && numeral(1000).format('0,0 $');

numeral.locale('en-gb');
let string2 = numeral(50).format('0.0[0]');

numeral.locale('en');

Note: the "en" locale is loaded by default.

FastBoot compatibility

This addon is compatible with FastBoot out of the box.

License

ember-cli-numeral shims is MIT Licensed.

Keywords

ember-addon

FAQs

Package last updated on 18 Oct 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts