Skip to content

civicsource/knockout.money

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Knockout Money Extender

A simple knockout extender which wraps accounting.js.

Installation

npm install knockout.money

Usage

require the script in your bundle, then:

var money = ko.observable().extend({ money: true });
money("17000");

console.log(money()); //17000
console.log(money.formatted()); //$17,000.00

You can also use it to set formatted money as a value. This is useful for binding user-editable text boxes to the formatted computed.

money.formatted("$17,000.56");
console.log(money()); //17000.56

About

A simple knockout extender that wraps accounting.js

Resources

License

Stars

Watchers

Forks

Packages

No packages published