Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/johno/ember-percentages
Ember helpers for percentage formatting.
https://github.com/johno/ember-percentages
Last synced: 2 months ago
JSON representation
Ember helpers for percentage formatting.
- Host: GitHub
- URL: https://github.com/johno/ember-percentages
- Owner: johno
- License: mit
- Created: 2014-12-14T22:37:01.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2018-10-18T10:20:11.000Z (over 6 years ago)
- Last Synced: 2024-10-19T17:49:14.364Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 29.3 KB
- Stars: 2
- Watchers: 3
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# ember-percentages [![Build Status](https://travis-ci.org/johnotander/ember-percentages.svg?branch=master)](https://travis-ci.org/johnotander/ember-percentages) [![Ember Observer Score](http://emberobserver.com/badges/ember-percentages.svg)](http://emberobserver.com/addons/ember-percentages)
A helper for formatting percentages from floats to human readable numbers.
## Installation
```
ember install ember-percentages
```## Usage
```hbs
{{percentage '0.87235'}} {{! => '87.235%'}}
{{percentage '0.87235' decimals=1}} {{! => '87.2%'}}
{{percentage someProperty}} {{! => '12.8%'}}
```##### You can specify the decimal place for rounding
```hbs
{{percentage '0.87235' decimals=2}} {{! => '82.24%'}}
```##### There's a shortcut provided, too
```hbs
{{pct '0.1234567' decimals=2}} {{! => '12.35%'}}
```## License
MIT
## Contributing
1. Fork it
* Create your feature branch (`git checkout -b my-new-feature`)
* Install the dependencies and run gulp (`npm i && gulp`)
* Commit your changes (`git commit -am 'Add some feature'`)
* Push to the branch (`git push origin my-new-feature`)
* Create new Pull Request***
> Crafted with <3 by [John Otander](http://johnotander.com) ([@4lpine](https://twitter.com/4lpine)).