{"_id":"cur","_rev":"5-150626c62f613880f081a2af382d6343","name":"cur","time":{"modified":"2022-04-28T00:53:12.373Z","created":"2017-03-06T06:57:23.513Z","1.0.0":"2017-03-06T06:57:23.513Z","1.0.1":"2017-09-30T03:02:14.693Z","1.0.2":"2017-09-30T03:15:09.794Z","1.0.3":"2017-10-20T14:12:59.694Z"},"maintainers":[{"name":"aervin","email":"aaron.jeffrey.ervin@gmail.com"}],"dist-tags":{"latest":"1.0.3"},"description":"It formats currency using Javascript","readme":"[![CircleCI](https://circleci.com/gh/aervin/cur/tree/master.svg?style=shield)](https://circleci.com/gh/aervin/cur/tree/master)\n[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n![minified](http://img.badgesize.io/aervin/cur/master/cur.js?label=minified)\n\n# cur\n\nIf you want to format currency, it'll cost you 1kb.\n\n### Installation:\n```\nnpm i -S cur@latest\n```\n<br>\n\n\n### Usage:\n```\ncur(\n    figureToBeFormatted: number,\n    returnDollarsAndCents: boolean, \n    config: { thousandsSeparator: string, decimalSeparator: string }\n) => string | undefined\n```\n<br>\n\n\n### Example with cents:\n```\nconst cur = require('cur')\nconst dollars = 1234.56\nconst formattedDollars = cur(dollars, true)\n\nconsole.log(`$${formattedDollars}`)\n// =>  $1,234.56\n```\n\n### Example without cents:\n```\nimport cur from 'cur'\nconst dollars = 1234.56\nconst formattedDollars = cur(dollars)\n\nconsole.log(`$${formattedDollars}`)\n// =>  $1,235\n```\n\n### Separators:\n`cur` accepts an optional `config` argument with two properties, `thousandsSeparator` and `decimalSeparator`.\n```\nconst formatCurrency = require('cur')\nconst config = { thousandsSeparator: \"'\", decimalSeparator: \",\" }\nconst amount = 1234.56\nconst formattedAmount = formatCurrency(amount, true, config)\n\nconsole.log(formattedAmount)\n// => 1'234,56\n```\n","versions":{"1.0.1":{"name":"cur","version":"1.0.1","description":"It formats currency using Javascript","main":"cur.js","scripts":{"build":"node ./build.js","test":"npm run build && node ./test.js","format":"prettier --write --tab-width 4 --no-semi --trailing-comma none ./*.js"},"repository":{"type":"git","url":"git+https://github.com/aervin/cur.git"},"keywords":["javascript","currency","usd","formatting","money","dollars"],"author":{"name":"aaron.jeffrey.ervin@gmail.com"},"license":"ISC","bugs":{"url":"https://github.com/aervin/cur/issues"},"homepage":"https://github.com/aervin/cur#readme","dependencies":{"buffered-reader":"^1.0.1"},"devDependencies":{"colors":"^1.1.2","prettier":"^1.5.3","uglify-js":"^3.1.1"},"gitHead":"7ad9b67c1e10cbd1e326285db6cb593f9270a7e9","_id":"cur@1.0.1","_npmVersion":"5.4.1","_nodeVersion":"8.4.0","_npmUser":{"name":"aervin","email":"aaron.jeffrey.ervin@gmail.com"},"dist":{"integrity":"sha512-kxs8HFOttJ7shX/OuPXVaLQNbckmGu4HLXS610h7jD5KY5Bz1lUKBsFNnDBS/tuiUKa+9Lb1icFlGEEhCVo+4g==","shasum":"043f37a328bd7a9786b50b87b64b29a41c75cceb","tarball":"https://registry.npmjs.org/cur/-/cur-1.0.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDjxX2xoqCKwkYmYkQ8pjXngleWvT+Kn5e0csks4btddQIgYpVsfnn01peRD4WOi+4WxBddbUFi4Cy2vyGxpxbPaZE="}]},"maintainers":[{"name":"aervin","email":"aaron.jeffrey.ervin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cur-1.0.1.tgz_1506740533721_0.7022026795893908"}},"1.0.2":{"name":"cur","version":"1.0.2","description":"It formats currency using Javascript","main":"cur.js","scripts":{"build":"node ./build.js","test":"npm run build && node ./test.js","format":"prettier --write --tab-width 4 --no-semi --trailing-comma none ./*.js"},"repository":{"type":"git","url":"git+https://github.com/aervin/cur.git"},"keywords":["javascript","currency","usd","formatting","money","dollars"],"author":{"name":"aaron.jeffrey.ervin@gmail.com"},"license":"ISC","bugs":{"url":"https://github.com/aervin/cur/issues"},"homepage":"https://github.com/aervin/cur#readme","dependencies":{"buffered-reader":"^1.0.1"},"devDependencies":{"colors":"^1.1.2","prettier":"^1.5.3","uglify-js":"^3.1.1"},"gitHead":"fe4794b4d729bcdbbff945e5a973df0d6c3d9615","_id":"cur@1.0.2","_npmVersion":"5.4.1","_nodeVersion":"8.4.0","_npmUser":{"name":"aervin","email":"aaron.jeffrey.ervin@gmail.com"},"dist":{"integrity":"sha512-W4/mWH341mMZnDMWuHZhMZBHz4RR8xzrQyvMMCw/NjPE424qmY1sEfE5w8lknIE7zRknnSJOz6enUBvpOS1/Hg==","shasum":"9734a15d36998280c37e9be443b15fe0ba108dee","tarball":"https://registry.npmjs.org/cur/-/cur-1.0.2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGwWQy5uYK97H8UXmAvNTLsa3wtMMBeJJnVyUORVJ9EpAiBfUBSRY9sEIve06hYlVC8VJklI3FhnkhrOgq4npNHhzg=="}]},"maintainers":[{"name":"aervin","email":"aaron.jeffrey.ervin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cur-1.0.2.tgz_1506741308861_0.4951962565537542"}},"1.0.3":{"name":"cur","version":"1.0.3","description":"It formats currency using Javascript","main":"cur.js","scripts":{"build":"node ./build.js","test":"npm run build && node ./test.js","format":"prettier --write --tab-width 4 --no-semi --trailing-comma none ./*.js"},"repository":{"type":"git","url":"git+https://github.com/aervin/cur.git"},"keywords":["javascript","currency","usd","formatting","money","dollars"],"author":{"name":"aaron.jeffrey.ervin@gmail.com"},"license":"ISC","bugs":{"url":"https://github.com/aervin/cur/issues"},"homepage":"https://github.com/aervin/cur#readme","dependencies":{"buffered-reader":"^1.0.1"},"devDependencies":{"colors":"^1.1.2","prettier":"^1.5.3","uglify-js":"^3.1.1"},"gitHead":"22d4ad171bac719cc0a5068e37304b61432002c8","_id":"cur@1.0.3","_npmVersion":"5.4.1","_nodeVersion":"8.4.0","_npmUser":{"name":"aervin","email":"aaron.jeffrey.ervin@gmail.com"},"dist":{"integrity":"sha512-6cbsAKMGnoZsLCgHyQ9+QZnzcphNDATGUKqSSG+lCiM9scutn2P01u8VgUr1JazaQ4o5zzpVNQbcexTjslIWCQ==","shasum":"edcc91477012d2536367a750abfc2deecbfc9a74","tarball":"https://registry.npmjs.org/cur/-/cur-1.0.3.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBGMXh/8JFk0HUL1d55IwvrzQ3jaDfGJfjCQ+SJk35UhAiEAmSV8oxd9BaQ3LJ5dS6q8QzTGoS5/zQLFB1g8yveFU9g="}]},"maintainers":[{"name":"aervin","email":"aaron.jeffrey.ervin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cur-1.0.3.tgz_1508508778815_0.11947188689373434"}}},"homepage":"https://github.com/aervin/cur#readme","keywords":["javascript","currency","usd","formatting","money","dollars"],"repository":{"type":"git","url":"git+https://github.com/aervin/cur.git"},"author":{"name":"aaron.jeffrey.ervin@gmail.com"},"bugs":{"url":"https://github.com/aervin/cur/issues"},"license":"ISC","readmeFilename":"README.md"}