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