Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/webengage/nunjucks-numeral-filter
A nunjucks filter for numeral.js
https://github.com/webengage/nunjucks-numeral-filter
Last synced: 16 days ago
JSON representation
A nunjucks filter for numeral.js
- Host: GitHub
- URL: https://github.com/webengage/nunjucks-numeral-filter
- Owner: WebEngage
- Created: 2017-01-14T16:56:01.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-01-14T17:32:23.000Z (almost 8 years ago)
- Last Synced: 2024-11-01T05:06:38.184Z (16 days ago)
- Language: JavaScript
- Size: 1.95 KB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# nunjucks-numeral-filter
A [Nunjucks](http://mozilla.github.io/nunjucks/) filter for [numeral.js](http://numeraljs.com/)### Install
```shell
npm install nunjucks-numeral-filter --save
```### Use
You must first include the filter and then add it to your nunjucks environment
```js
var numeralFilter = require('nunjucks-numeral-filter');var env = new nunjucks.Environment();
env.addFilter('numeral', numeralFilter);
```You can then call the filter in your nunjucks templates:
```
// parse a number string
{% set number = "$10,000.00" | numeral("value") %}// or format a number
Salary paid out is {{ 104000 | numeral("0a") }}.
```See all [available formats](http://numeraljs.com/#format)
### License - [WTFPL](http://www.wtfpl.net/)
```
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004Copyright (C) 2015 WebEngage
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION0. You just DO WHAT THE FUCK YOU WANT TO.
```