Ember-cli-accounting is an Ember CLI addon that integrates the `accounting.js` library into Ember applications, providing robust number and currency formatting capabilities. It ports `accounting.js` (specifically version 0.4.1 as of addon version 2.1.0) to ES6 modules, allowing for selective imports to optimize bundle size. The addon ships with both JavaScript functions and convenient Handlebars helpers (`format-number`, `format-money`) for use directly in templates. It also supports configuring default formatting options via Ember initializers. The addon's versioning does not match the underlying `accounting.js` library, but the maintainer aims to keep it updated with the original library's bug fixes and features. The current stable version is 2.1.1, with recent updates addressing Ember deprecations. It is distinct from directly including `accounting.js` by offering deep Ember integration and ES module support.
npm install ember-cli-accountingVerified import paths — ran on the pinned version, not inferred.
Demonstrates importing specific accounting functions and settings, configuring global defaults via an initializer, and using both JavaScript functions and Handlebars helpers for formatting currency and numbers.
Consult the 'Ember compatibility' section of the README. For Ember 2.0+, use `ember-cli-accounting@1.0.0` or higher. For Ember 1.10-1.13, use `ember-cli-accounting@0.1.x`. For older Ember versions, use `ember-cli-accounting@0.0.4`.
Upgrade to `ember-cli-accounting@2.1.1` or newer to remove the deprecated `Ember.assign` usage.
To check the bundled `accounting.js` version, import `version` from `accounting/version` (e.g., `import version from 'accounting/version';`). The README states v2.1.0 bundles accounting.js v0.4.1.
Update `ember-cli-accounting` to version 2.1.1 or higher: `ember update ember-cli-accounting` or `npm install ember-cli-accounting@latest`.
Ensure the import path is exact: `import formatMoney from 'accounting/format-money';`. Confirm your Ember CLI project is configured for ES modules.