OsrsNeedsF2P@lemmy.ml to Programmer Humor@programming.dev · 5 months agoparseInt(5)lemmy.mlimagemessage-square14linkfedilinkarrow-up15arrow-down10
arrow-up15arrow-down1imageparseInt(5)lemmy.mlOsrsNeedsF2P@lemmy.ml to Programmer Humor@programming.dev · 5 months agomessage-square14linkfedilink
minus-squaredanda@lemmy.ziplinkfedilinkarrow-up2·5 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
.