Closed nikhilverma360 closed 1 month ago
The commify
function in web/src/utils/commify.ts
was revised to improve its handling of specific edge cases. The return value now defaults to "0"
instead of converting the input to a string when the input does not match the expected numeric pattern. This ensures a more reliable and predictable output, particularly for problematic inputs like "."
, "-."
, or an empty string.
Files | Change Summary |
---|---|
web/src/utils/commify.ts |
Updated the commify function to return "0" for non-numeric patterns instead of value.toString() . |
In the code's realm, a twist unfolds,
commify
now a story told.
For dots and dashes lost in space,
Returns a zero, takes their place.
Through digits new, our function grows,
Safe and sound, the output shows.
🐇✨ Code leaps forward as we compose!
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Name | Link |
---|---|
Latest commit | 7630d4272a70a68a692f70b3c2bacb1d3faf4a13 |
Latest deploy log | https://app.netlify.com/sites/kleros-v2-university/deploys/667d6441b87b9500081ae069 |
Deploy Preview | https://deploy-preview-1624--kleros-v2-university.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
Name | Link |
---|---|
Latest commit | 7630d4272a70a68a692f70b3c2bacb1d3faf4a13 |
Latest deploy log | https://app.netlify.com/sites/kleros-v2/deploys/667d6441a3c3e00008eb8c88 |
Deploy Preview | https://deploy-preview-1624--kleros-v2.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
Name | Link |
---|---|
Latest commit | 7630d4272a70a68a692f70b3c2bacb1d3faf4a13 |
Latest deploy log | https://app.netlify.com/sites/kleros-v2-neo/deploys/667d644141ce65000846c847 |
Deploy Preview | https://deploy-preview-1624--kleros-v2-neo.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
Code Climate has analyzed commit 7630d427 and detected 0 issues on this pull request.
View more on Code Climate.
Failed conditions
1 Security Hotspot
D Maintainability Rating on New Code (required ≥ A)
See analysis details on SonarCloud
Catch issues before they fail your Quality Gate with our IDE extension
SonarLint
PR-Codex overview
This PR simplifies the
commify
function incommify.ts
by improving the validation logic for numeric values.Detailed summary
commify.ts
Summary by CodeRabbit
commify
function. Now returns"0"
for inputs like ".", "-.", or an empty string, ensuring consistent and expected behavior.