accounting-helpers
Stache helpers for formatting money.
Installation
npm install accounting-helpers --save
Usage
Using CanJS's built-in support for StealJS, you can now import the module directly inside your templates. For example, assuming we have a variable amount
which holds the value 2333
.
This will return 2,333.00:{{formatMoney amount}} This will return 23.33:{{formatCents amount}}
The two examples above will include live binding. To opt out use the Unbound
options, like this:
This will return 2,333.00 without live binding:{{formatMoneyUnbound amount}} This will return 23.33 without live binding:{{formatCentsUnbound amount}}
Use individual helpers in can-component
If you need to, you can import the helpers individually.
;;;;; Component;
Contributing
Pull requests are welcome. Analyze the code. See where it needs improvement, and let me know. Please, help make it better!
Changelog
3.0.0
- CanJS 3.0 compatibility.1.0.0
- CanJS 2.3 compatibility.