OsrsNeedsF2P@lemmy.ml to Programmer Humor@programming.dev · 1 year agoparseInt(5)lemmy.mlimagemessage-square17linkfedilinkarrow-up18arrow-down10
arrow-up18arrow-down1imageparseInt(5)lemmy.mlOsrsNeedsF2P@lemmy.ml to Programmer Humor@programming.dev · 1 year agomessage-square17linkfedilink
minus-squaredanda@lemmy.ziplinkfedilinkarrow-up2·1 year 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.