{"id":15761636,"url":"https://github.com/alrico88/number-helper-functions","last_synced_at":"2026-01-20T11:31:54.353Z","repository":{"id":35023625,"uuid":"197726898","full_name":"alrico88/number-helper-functions","owner":"alrico88","description":"Helper with multiple number-related methods","archived":false,"fork":false,"pushed_at":"2023-10-08T08:28:08.000Z","size":376,"stargazers_count":1,"open_issues_count":4,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-11T17:22:22.149Z","etag":null,"topics":["decimals","helpers","javascript","node","number","round"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/number-helper-functions","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/alrico88.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":"2019-07-19T07:44:54.000Z","updated_at":"2022-04-26T23:34:56.000Z","dependencies_parsed_at":"2024-06-21T15:34:21.334Z","dependency_job_id":"18acb2bb-48ba-40f5-be3f-f3c8d3d0683a","html_url":"https://github.com/alrico88/number-helper-functions","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/alrico88/number-helper-functions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alrico88%2Fnumber-helper-functions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alrico88%2Fnumber-helper-functions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alrico88%2Fnumber-helper-functions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alrico88%2Fnumber-helper-functions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alrico88","download_url":"https://codeload.github.com/alrico88/number-helper-functions/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alrico88%2Fnumber-helper-functions/sbom","scorecard":{"id":186827,"data":{"date":"2025-08-11","repo":{"name":"github.com/alrico88/number-helper-functions","commit":"49e3ea0bddc78929767eb368d535c2d044908b69"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.5,"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":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","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":"Code-Review","score":0,"reason":"Found 0/28 approved changesets -- score normalized to 0","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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/alrico88/number-helper-functions/main.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/alrico88/number-helper-functions/main.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/alrico88/number-helper-functions/main.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/alrico88/number-helper-functions/main.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/size.yml:9: update your workflow using https://app.stepsecurity.io/secureworkflow/alrico88/number-helper-functions/size.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/size.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/alrico88/number-helper-functions/size.yml/master?enable=pin","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction dependencies pinned"],"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/main.yml:1","Warn: no topLevel permission defined: .github/workflows/size.yml:1","Info: no jobLevel write permissions found"],"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":"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":"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":"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":"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":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"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":"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 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"}},{"name":"Vulnerabilities","score":0,"reason":"29 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-67mh-4wv8-2f99","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-4q6p-r6v2-jvc5","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-7fh5-64p2-3v2j","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-3mv9-4h5g-vhg3","Warn: Project is vulnerable to: GHSA-mv48-hcvh-8jj8","Warn: Project is vulnerable to: GHSA-353f-5xf4-qw67","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","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-16T19:56:38.983Z","repository_id":35023625,"created_at":"2025-08-16T19:56:38.983Z","updated_at":"2025-08-16T19:56:38.983Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28602446,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T10:46:13.255Z","status":"ssl_error","status_checked_at":"2026-01-20T10:42:51.865Z","response_time":117,"last_error":"SSL_read: 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":["decimals","helpers","javascript","node","number","round"],"created_at":"2024-10-04T11:03:18.583Z","updated_at":"2026-01-20T11:31:54.337Z","avatar_url":"https://github.com/alrico88.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# number-helper-functions\n\nLibrary with multiple number-related methods.\n\n## Installation\n\n### Using npm\n\n`npm i number-helper-functions`\n\n### Using yarn\n\n`yarn add number-helper-functions`\n\n## Usage\n\n### In a CommonJS env\n\n```javascript\nconst NumberHelper = require('number-helper-functions');\n\nNumberHelper.isInt(4); // returns true\n```\n\nor\n\n```javascript\nconst { isFinite } = require('number-helper-functions');\n\nNumberHelper.isFinite(Infinity); // returns false\n```\n\n### Using ES6 imports\n\n```javascript\nimport NumberHelper from 'number-helper-functions';\n\nNumberHelper.isInt(4); // returns true\n```\n\nor\n\n```javascript\nimport { processNumber } from 'number-helper-functions';\n\nNumberHelper.processNumber('4.5432', 2); // returns 4.54\n```\n\n## Documentation\n\n## Table of contents\n\n### Functions\n\n- [checkDecimals](#checkdecimals)\n- [convertToNumber](#converttonumber)\n- [enforceNumber](#enforcenumber)\n- [getRandom](#getrandom)\n- [isEven](#iseven)\n- [isFloat](#isfloat)\n- [isInt](#isint)\n- [isNumber](#isnumber)\n- [isOdd](#isodd)\n- [isPrime](#isprime)\n- [prefixWithZeros](#prefixwithzeros)\n- [processNumber](#processnumber)\n- [rangeBetween](#rangebetween)\n\n## Functions\n\n### checkDecimals\n\n▸ **checkDecimals**(`number`: NumberLike): _number_\n\nChecks the decimals of a number\n\n#### Parameters:\n\n| Name     | Type       | Description                               |\n| :------- | :--------- | :---------------------------------------- |\n| `number` | NumberLike | Number to check the amount of decimals of |\n\n**Returns:** _number_\n\nThe number of decimals\n\nDefined in: modules/format.ts:21\n\n---\n\n### convertToNumber\n\n▸ **convertToNumber**(`toCheck`: NumberLike, `decimals?`: _number_): _number_\n\nConverts string to number\n\n#### Parameters:\n\n| Name       | Type       | Default value | Description            |\n| :--------- | :--------- | :------------ | :--------------------- |\n| `toCheck`  | NumberLike | -             | Number-like to convert |\n| `decimals` | _number_   | 2             | -                      |\n\n**Returns:** _number_\n\nConverted number\n\nDefined in: modules/format.ts:38\n\n---\n\n### enforceNumber\n\n▸ **enforceNumber**(`n`: NumberLike): _number_\n\n#### Parameters:\n\n| Name | Type       |\n| :--- | :--------- |\n| `n`  | NumberLike |\n\n**Returns:** _number_\n\nDefined in: modules/base.ts:3\n\n---\n\n### getRandom\n\n▸ **getRandom**(`min`: _number_, `max`: _number_): _number_\n\nGets random integer number in a range\n\n#### Parameters:\n\n| Name  | Type     | Description    |\n| :---- | :------- | :------------- |\n| `min` | _number_ | Minimum number |\n| `max` | _number_ | Maximum number |\n\n**Returns:** _number_\n\nRandom number in range\n\nDefined in: modules/random.ts:8\n\n---\n\n### isEven\n\n▸ **isEven**(`n`: NumberLike): _boolean_\n\nChecks if number is even\nAny integer that can be divided exactly by 2 is an even number\n\n#### Parameters:\n\n| Name | Type       | Description     |\n| :--- | :--------- | :-------------- |\n| `n`  | NumberLike | Number to check |\n\n**Returns:** _boolean_\n\nWhether the number is even or not\n\nDefined in: modules/checks.ts:49\n\n---\n\n### isFloat\n\n▸ **isFloat**(`n`: NumberLike): _boolean_\n\nChecks if element is a float number\n\n#### Parameters:\n\n| Name | Type       | Description     |\n| :--- | :--------- | :-------------- |\n| `n`  | NumberLike | Number to check |\n\n**Returns:** _boolean_\n\nWhether the number is a float or not\n\nDefined in: modules/checks.ts:34\n\n---\n\n### isInt\n\n▸ **isInt**(`n`: NumberLike): _boolean_\n\nChecks if element is an integer\n\n#### Parameters:\n\n| Name | Type       | Description     |\n| :--- | :--------- | :-------------- |\n| `n`  | NumberLike | Number to check |\n\n**Returns:** _boolean_\n\nWhether the number is an integer or not\n\nDefined in: modules/checks.ts:20\n\n---\n\n### isNumber\n\n▸ **isNumber**(`n`: NumberLike): _boolean_\n\nChecks if element is a number\n\n#### Parameters:\n\n| Name | Type       | Description          |\n| :--- | :--------- | :------------------- |\n| `n`  | NumberLike | The element to check |\n\n**Returns:** _boolean_\n\nWhether the element is a number or not\n\nDefined in: modules/checks.ts:10\n\n---\n\n### isOdd\n\n▸ **isOdd**(`n`: NumberLike): _boolean_\n\nChecks if number is odd\nAny integer that cannot be divided exactly by 2 is an odd number.\n\n#### Parameters:\n\n| Name | Type       | Description     |\n| :--- | :--------- | :-------------- |\n| `n`  | NumberLike | Number to check |\n\n**Returns:** _boolean_\n\nWhether the number is odd or not\n\nDefined in: modules/checks.ts:60\n\n---\n\n### isPrime\n\n▸ **isPrime**(`num`: _number_): _boolean_\n\nChecks if number is prime\nNatural number greater than 1 that cannot be formed by multiplying two smaller natural numbers\n\n#### Parameters:\n\n| Name  | Type     | Description     |\n| :---- | :------- | :-------------- |\n| `num` | _number_ | Number to check |\n\n**Returns:** _boolean_\n\nWhether the numbere is prime or not\n\nDefined in: modules/checks.ts:71\n\n---\n\n### prefixWithZeros\n\n▸ **prefixWithZeros**(`number`: _number_, `length`: _number_): _string_\n\nPrefixes a number with zeros until desired length\n\n#### Parameters:\n\n| Name     | Type     | Description           |\n| :------- | :------- | :-------------------- |\n| `number` | _number_ | Number to pad         |\n| `length` | _number_ | Desired number length |\n\n**Returns:** _string_\n\nPadded number as a string\n\nDefined in: modules/format.ts:12\n\n---\n\n### processNumber\n\n▸ **processNumber**(`value`: NumberLike, `decimals?`: _number_): _number_\n\nProcesses number to get clean value\n\n#### Parameters:\n\n| Name       | Type       | Default value | Description                 |\n| :--------- | :--------- | :------------ | :-------------------------- |\n| `value`    | NumberLike | -             | String or number to process |\n| `decimals` | _number_   | 2             | -                           |\n\n**Returns:** _number_\n\nParsed and processed number\n\nDefined in: modules/format.ts:55\n\n---\n\n### rangeBetween\n\n▸ **rangeBetween**(`start`: _number_, `end`: _number_, `step`: _number_): _number_[]\n\nCreates a range between start and end, including them, according to step\n\n#### Parameters:\n\n| Name    | Type     | Description               |\n| :------ | :------- | :------------------------ |\n| `start` | _number_ | Starting value            |\n| `end`   | _number_ | End value                 |\n| `step`  | _number_ | Step to use for the range |\n\n**Returns:** _number_[]\n\nThe range\n\nDefined in: modules/utilities.ts:12\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falrico88%2Fnumber-helper-functions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falrico88%2Fnumber-helper-functions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falrico88%2Fnumber-helper-functions/lists"}