0.3.4 • Published 5 years ago

@mediapop/ember-humanize v0.3.4

Weekly downloads
7
License
MIT
Repository
-
Last release
5 years ago

ember-humanize

This ember addon is maintained by Media Pop, a software consultancy. Hire us to solve your web application challenges. Build Status

An ember helper wrapper for humanize's most useful functions that are unavailable in vanilla JS and native Ember.js

Installation

ember install @mediapop/ember-humanize

Usage

Use in any template. You can also customise the display using the optional named parameters.

humanize-compact-number

Shortens the number to well known abbreviations.

{{humanize-compact-number 123456789}}
//123M

{{humanize-compact-number 123456789 decimals=2}}
//123.46M

humanize-number

similar to JS's toLocaleString() but with custom control over thousands and decimal seperators

{{humanize-number 10000000}}
//10,000,000

{{humanize-number 10000000 precision=2 thousand=' ' decimal=','}}
//10 000 000,000

humanize-ordinal-number

expresses numbers in their ordinal form

{{humanize-ordinal-number 1332}}
//1332nd

Contributing

Installation

  • git clone https://github.com/mediapop/ember-humanize
  • cd ember-humanize
  • npm install

Linting

  • npm run lint:hbs
  • npm run lint:js
  • npm run lint:js -- --fix

Running tests

  • ember test – Runs the test suite on the current Ember version
  • ember test --server – Runs the test suite in "watch mode"
  • ember try:each – Runs the test suite against multiple Ember versions

Running the dummy application

For more information on using ember-cli, visit https://ember-cli.com/.

License

This project is licensed under the MIT License.