minus-squaredanda@lemmy.ziptoProgrammer Humor@programming.dev•parseInt(5)linkfedilinkarrow-up100·3 days agoIt’s because parseInt is expecting a string, so the decimal gets converted to a string, and 0.0000005.toString() returns 5e-7. linkfedilink
It’s because parseInt is expecting a string, so the decimal gets converted to a string, and
0.0000005.toString()
returns5e-7
.