OsrsNeedsF2P@lemmy.ml to Programmer Humor@programming.dev · 3 months agoparseInt(5)lemmy.mlimagemessage-square4linkfedilinkarrow-up11arrow-down10
arrow-up11arrow-down1imageparseInt(5)lemmy.mlOsrsNeedsF2P@lemmy.ml to Programmer Humor@programming.dev · 3 months agomessage-square4linkfedilink
minus-squaredanda@lemmy.ziplinkfedilinkarrow-up1·3 months agoIt’s because parseInt is expecting a string, so the decimal gets converted to a string, and 0.0000005.toString() returns 5e-7.
It’s because parseInt is expecting a string, so the decimal gets converted to a string, and
0.0000005.toString()
returns5e-7
.