Skip to content

Accounting.js smart package - number, money and currency formatting - fully localisable, zero dependencies.

Notifications You must be signed in to change notification settings

badslug/meteor-accounting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Smart package for Accounting.js by Joss Crowcroft.

accounting.js is a tiny JavaScript library for number, money and currency formatting, with optional excel-style column rendering (to line up symbols and decimals). It's lightweight, fully localisable and has zero dependencies.

See the Accounting.js website for documentation.

Usage

Install using standard meteor:

meteor install iain:accounting

Use in Javascript by importing (for example in server/main.js of a fresh meteor project):

import { Meteor } from 'meteor/meteor';
import { accounting } from 'meteor/iain:accounting';

Meteor.startup(() => {
  // code to run on server at startup
  console.log(accounting.formatMoney(123456789))
});

Blaze Template Example

In your Javascript for your template (e.g. asset.js):

import { Template } from 'meteor/templating';
import { accounting } from 'meteor/iain:accounting';

Template.asset.helpers({
  formatCurrency(value) {
    return accounting.formatMoney(value);
  },
});

In your template (e.g. asset.html)

<template name="asset">
      {{formatCurrency initialValue}}
</template>

About

Accounting.js smart package - number, money and currency formatting - fully localisable, zero dependencies.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •