{"id":20887001,"url":"https://github.com/fleetbase/ember-accounting","last_synced_at":"2025-05-12T19:33:05.514Z","repository":{"id":212233165,"uuid":"730975956","full_name":"fleetbase/ember-accounting","owner":"fleetbase","description":"Updated port of the great accounting.js library to ES6 modules that integrates seamlessly with ember-cli","archived":false,"fork":false,"pushed_at":"2023-12-20T07:34:29.000Z","size":174,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-29T08:04:09.414Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fleetbase.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-12-13T04:53:56.000Z","updated_at":"2024-01-16T04:28:48.000Z","dependencies_parsed_at":"2023-12-13T07:49:40.154Z","dependency_job_id":null,"html_url":"https://github.com/fleetbase/ember-accounting","commit_stats":null,"previous_names":["fleetbase/ember-accounting"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fleetbase%2Fember-accounting","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fleetbase%2Fember-accounting/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fleetbase%2Fember-accounting/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fleetbase%2Fember-accounting/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fleetbase","download_url":"https://codeload.github.com/fleetbase/ember-accounting/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225148821,"owners_count":17428453,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-18T08:18:44.080Z","updated_at":"2024-11-18T08:18:45.246Z","avatar_url":"https://github.com/fleetbase.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @fleetbase/ember-accounting\n\nThis is a fork of [ember-cli-accounting](https://github.com/milindalvares/ember-cli-accounting) which was a port of the great [accounting.js](https://github.com/openexchangerates/accounting.js) library to\nES6 modules that integrates seamlessly with ember-cli and the Fleetbase ecosystem.\n\n## Installation\n\nJust add like any other ember-cli addon:\n\n```bash\nnpm install @fleetbase/ember-accounting\n```\n\n## Ember compatiblity\n\nCompatible with Ember version 4.0 and above\n\n## Usage\n\n### Accounting functions\n\nYou no longer need to access the global accounting, you can import only what you need:\n\n```js\nimport formatMoney from '@fleetbase/ember-accounting/format-money'\n```\n\nAlthough you can import everything as expected:\n\n```js\nimport accounting from '@fleetbase/ember-accounting'\n```\n\n### Handlebars helpers\n\nThis addon also registers 2 handy helpers in your application: `format-number` and `format-money`.\n\nYou can set options using bound or unbound options like this:\n\n```hbs\n{{format-money price symbol=selectedCurrency format=\"%v %s\"}} \u003c!-- \"123.45 £\" --\u003e\n```\n\nAny option not set will have the usual default value:\n\n```hbs\n{{format-number \"1234.567\" precision=2}} \u003c!-- \"1,234.57\" --\u003e\n```\n\n### Config default options\n\nYou can use an initializer to set some default values at initializations and avoid having to \nrepeat over and over the options in the helpers.\n\nUse something like this:\n```js\n// app/initializers/accounting.js\nimport { currency, number } from '@fleetbase/ember-accounting/settings';\n\nexport default {\n  name: 'accounting.js',\n  initialize: function() {\n    currency.symbol = \"€\";\n    number.decimal = \",\";\n    number.thousand = \".\";\n  }\n};\n```\n\n## Differences with accounting.js\n\nAlthough this is almost a 1:1 port of accountant.js, there is a few differences:\n\n* Each function of accountant.js lives in its own module, so you can only import those functions you want to use.\n* Removed some polyfills for `Array.isArray`, `Array.prototype.map` and `Object.prototype.toString`.\nThey are not required in modern browsers, and ember.js (unless you opt-out with `EXTEND_PROTOTYPES = false`) already provides polyfills for those functions.\n* More tests than the original.\n* Enforced jshint. Cleaner code.\n\n## Documentation\n\nThis library does not make any change in the public api of accounting.js, so you can read the official\ndocumentation [here](http://openexchangerates.github.io/accounting.js/)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffleetbase%2Fember-accounting","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffleetbase%2Fember-accounting","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffleetbase%2Fember-accounting/lists"}