parseInt(0.0000005)
// --> 5
JavaScript converts the first parameter to parseInt()
to a string with ToString()
that looks the same for 0.5
to 0.000005
.
But 0.0000005
gets represented by "5e-7"
(= 5 × 10-7).
And there’s the 5.
parseInt(0.0000005)
// --> 5
JavaScript converts the first parameter to parseInt()
to a string with ToString()
that looks the same for 0.5
to 0.000005
.
But 0.0000005
gets represented by "5e-7"
(= 5 × 10-7).
And there’s the 5.