{"id":25008091,"url":"https://github.com/vend/vend-number","last_synced_at":"2026-03-06T09:33:48.361Z","repository":{"id":19610523,"uuid":"22861728","full_name":"vend/vend-number","owner":"vend","description":"💯🦺 A collection of utility methods for floating point Number operations","archived":false,"fork":false,"pushed_at":"2024-07-16T02:45:21.000Z","size":375,"stargazers_count":5,"open_issues_count":3,"forks_count":0,"subscribers_count":98,"default_branch":"master","last_synced_at":"2025-10-11T07:14:07.438Z","etag":null,"topics":["backstage-exclude"],"latest_commit_sha":null,"homepage":"","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/vend.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-08-12T02:14:33.000Z","updated_at":"2024-07-16T02:45:23.000Z","dependencies_parsed_at":"2023-11-06T05:25:11.376Z","dependency_job_id":"fcd7b7f7-ed40-4282-92a1-6a0bccf56007","html_url":"https://github.com/vend/vend-number","commit_stats":{"total_commits":103,"total_committers":14,"mean_commits":7.357142857142857,"dds":0.5922330097087378,"last_synced_commit":"52921f4d1b8c1993216846764ff41566f9521a83"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/vend/vend-number","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vend%2Fvend-number","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vend%2Fvend-number/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vend%2Fvend-number/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vend%2Fvend-number/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vend","download_url":"https://codeload.github.com/vend/vend-number/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vend%2Fvend-number/sbom","scorecard":{"id":918427,"data":{"date":"2025-08-11","repo":{"name":"github.com/vend/vend-number","commit":"52921f4d1b8c1993216846764ff41566f9521a83"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.9,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":6,"reason":"Found 8/12 approved changesets -- score normalized to 6","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"18 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-67mh-4wv8-2f99","Warn: Project is vulnerable to: GHSA-4q6p-r6v2-jvc5","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-7fh5-64p2-3v2j","Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm","Warn: Project is vulnerable to: GHSA-92r3-m2mg-pj97","Warn: Project is vulnerable to: GHSA-c24v-8rfc-w8vw","Warn: Project is vulnerable to: GHSA-8jhw-289h-jh2g","Warn: Project is vulnerable to: GHSA-64vr-g452-qvp3","Warn: Project is vulnerable to: GHSA-9cwx-2883-4wfx","Warn: Project is vulnerable to: GHSA-vg6x-rcgg-rjx6","Warn: Project is vulnerable to: GHSA-x574-m823-4x7w","Warn: Project is vulnerable to: GHSA-4r4m-qw57-chr8","Warn: Project is vulnerable to: GHSA-xcj6-pq6g-qj4x","Warn: Project is vulnerable to: GHSA-356w-63v5-8wf4","Warn: Project is vulnerable to: GHSA-859w-5945-r5v3"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 2 commits out of 27 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-24T22:48:30.518Z","repository_id":19610523,"created_at":"2025-08-24T22:48:30.518Z","updated_at":"2025-08-24T22:48:30.518Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30169028,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T07:56:45.623Z","status":"ssl_error","status_checked_at":"2026-03-06T07:55:55.621Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["backstage-exclude"],"created_at":"2025-02-05T02:56:55.523Z","updated_at":"2026-03-06T09:33:48.333Z","avatar_url":"https://github.com/vend.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"vend-number\n----------\n\n[![npm][npm-image]][npm-url]\n[![js-standard-style][standard-style-image]][standard-style-url]\n\n[npm-image]: https://img.shields.io/npm/v/vend-number.svg?style=flat\n[npm-url]: https://npmjs.org/package/vend-number\n[standard-style-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat\n[standard-style-url]: https://github.com/feross/standard\n\n\u003e A collection of utility methods for floating point Number operations\n\n![numbers](https://media.giphy.com/media/kJgJEc8TOiLra/giphy.gif)\n\n`vend-number` is a vend-flavoured wrapper for [BigNumber.js](https://github.com/MikeMcl/bignumber.js/).\n\nInstead of constructing `BigNumber` objects from your numbers and performing operations on them within your app, this module provides a set of simplified math utilities that take simple `Number` or `String` types, and use `BigNumber` operations for accuracy behind the scenes.\n\n## API\n\n`VendNumber` is an extension of the `BigNumber` class.\n\n```js\nimport VendNumber from 'vend-number'\n\nconst num = new VendNumber('123.456')\nnum.round(2) // '123.46'\nnum instanceof BigNumber // true\n```\n\nThere is a shortcut method of construction in `VendNumber.vn`:\n\n```js\nimport VendNumber, { vn } from 'vend-number'\n\nconst num = vn(123.456)\nnum.round(2) // '123.46'\nnum instanceof VendNumber // true\n```\n\n### Math operations\n\nThe following static methods can take any number of values and perform the operation on each of them in the specified order.\n\nAdd a list of values\n\n```js\nVendNumber.add(1, 2, 3) // 1 + 2 + 3 = 6\n```\n\nSubtract a list of values\n\n```js\nVendNumber.subtract(2, 1) // 2 - 1 = 1\n```\n\nMultiply a list of values\n\n```js\nVendNumber.multiply(2, 2) // 2 * 2 = 4\n```\n\nDivide a list of values\n\n```js\nVendNumber.divide(10, 2) // 10 / 2 = 5\n```\n\nKeep in mind when using the `VendNumber` math functions that when performing multiple calculations you will need to **make\nsure the execution order is correct**.\n\nNative JS will execute in order of **BEDMAS** automatically, whereas with these methods, you have to make sure of this manually.\n\nE.g.\n```js\n4 * 5 + 3 // returns 23\n\nmultiply(4, add(5, 3)) // returns 32\n```\n\nYou need to take into account the order in which the functions will be executed, so in this case it should be:\n\n```js\nadd(3, multiply(4, 5)) // returns 23\n```\n\n### Rounding and formatting\n\nRound a value to a specified number of decimal points. The default rounding mode is `ROUND_HALF_UP`, the 'Round Half\nAway From Zero' tie-breaking rule.\n\n```js\nVendNumber.round(5.545333, 2) // \"5.55\"\n```\n\n#### Rounding modes\n\nYou can specify any of the [Big Number rounding modes](http://mikemcl.github.io/bignumber.js/#round-up) to the `round`\nfunction. These are available via `VendNumber.ROUNDING_METHODS`.\n\n```js\nimport VendNumber, { ROUNDING_MODES } from 'vend-number'\n\nVendNumber.round(5.545333, 2, ROUNDING_MODES.ROUND_DOWN) // \"5.54\"\n```\n\n### isFinite\n\nA static equivalent to `BigNumber.isFinite` that reports `false` for non-numeric values.\n\n```js\nVendNumber.isFinite(null) // false\nVendNumber.isFinite('') // false\nVendNumber.isFinite(Infinity) // false\n\nVendNumber.isFinite(0) // true\nVendNumber.isFinite(Number.MAX_VALUE) // true\nVendNumber.isFinite('-123.456') // true\n```\n\n### sumBy\n\nCalculates the sum of all items in a collection based on a property name.\n\nAccepts the following parameters:\n\n  - `Array` an array of items to loop through.\n  - `String` a property name to sum by.\n  - `Number` an optional decimal points number to round the sum value to (defaults to 2 d.p.).\n\n**Example**:\n\n```js\nVendNumber.sumBy([], '') // 0.00\nVendNumber.sumBy([{ a: 1 }, { a: 2 }], 'a') // 3.00\nVendNumber.sumBy([{ a: 1.4222 }, { a: 2.1115 }], 'a', 3) // 3.534\n```\n\n## Contributing\n\n### Test\n\n```js\nyarn test\n```\n\n## License\n\nMIT © [Vend](github.com/vend)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvend%2Fvend-number","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvend%2Fvend-number","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvend%2Fvend-number/lists"}