Security News
Research
Supply Chain Attack on Rspack npm Packages Injects Cryptojacking Malware
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
fix-a-float
Advanced tools
Ever had this problem?
>> 0.1 + 0.2
0.30000000000000004
This solves that problem.
>> fixAfloat(0.1 + 0.2)
0.3
npm install fix-a-float
var fixAfloat = require('fix-a-float');
console.log(fixAfloat(0.1+0.2));
It converts the number to a string, looks for a long run of zeros or nines at the end, removes them, and coverts back to a float.
Absolutely not. Only use it in places where you need human readable numbers but don't know the precision you need. It doesn't actually solve any of the larger issues with floats.
FAQs
Remove precision nightmares from numbers.
The npm package fix-a-float receives a total of 1 weekly downloads. As such, fix-a-float popularity was classified as not popular.
We found that fix-a-float demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.
Security News
Sonar’s acquisition of Tidelift highlights a growing industry shift toward sustainable open source funding, addressing maintainer burnout and critical software dependencies.