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