Skip to content

fix: nstr returns empty string for 0 with maxDecimals: 0 - #11

Open
shm-dtt wants to merge 3 commits into
shuding:mainfrom
shm-dtt:main
Open

fix: nstr returns empty string for 0 with maxDecimals: 0#11
shm-dtt wants to merge 3 commits into
shuding:mainfrom
shm-dtt:main

Conversation

@shm-dtt

@shm-dtt shm-dtt commented Sep 17, 2025

Copy link
Copy Markdown

#9 - Fixed this issue.

Description:
When calling with e.g. nstr(0.3333333432674419, { maxDecimals: 0 }), the function returns an empty string ("") instead of "0". This happens because "0".replace(/.?0+$/, '') results in "". The expected result is "0".

This is fixed with the solution that was provided in the Issue link itself.

@vercel

vercel Bot commented Sep 17, 2025

Copy link
Copy Markdown

@shm-dtt is attempting to deploy a commit to the shu Team on Vercel.

A member of the Team first needs to authorize it.

dependabot Bot and others added 2 commits December 4, 2025 20:22
Bumps the npm_and_yarn group with 1 update in the / directory: [next](https://github.com/vercel/next.js).
Bumps the npm_and_yarn group with 1 update in the /example directory: [next](https://github.com/vercel/next.js).


Updates `next` from 15.5.0 to 15.5.7
- [Release notes](https://github.com/vercel/next.js/releases)
- [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
- [Commits](vercel/next.js@v15.5.0...v15.5.7)

Updates `next` from 15.5.0 to 15.5.7
- [Release notes](https://github.com/vercel/next.js/releases)
- [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
- [Commits](vercel/next.js@v15.5.0...v15.5.7)

---
updated-dependencies:
- dependency-name: next
  dependency-version: 15.5.7
  dependency-type: direct:production
  dependency-group: npm_and_yarn
- dependency-name: next
  dependency-version: 15.5.7
  dependency-type: direct:production
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
…rn-42d4ddb4a5

Bump the npm_and_yarn group across 2 directories with 1 update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant