OsrsNeedsF2P@lemmy.ml to Programmer Humor@programming.dev · 22 days agoparseInt(5)imagemessage-square12linkfedilinkarrow-up14arrow-down10
arrow-up14arrow-down1imageparseInt(5)OsrsNeedsF2P@lemmy.ml to Programmer Humor@programming.dev · 22 days agomessage-square12linkfedilink
minus-squaredanda@lemmy.ziplinkfedilinkarrow-up1·22 days 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
.