I got a question.
My backend recieve number string from frontend.
The important point is, I want to cut number at the second demical point.
ex1) '2.346' => 2.34
ex2) '2.3' => 2.3
ex3) '4.246' => 4.24
ex4) '4.1' => 4.1
And when I try this code with '2.346' or '4.246'
let v = '2.346'
v = parseInt(v * 100) / 100
console.log(v)
// v = 2.34
But when I try this code with 2.3 or 4.1, it makes wierd...
let v = '2.3'
v = parseInt(v * 100) / 100
console.log(v)
// v = 2.29
what is the problem in my code...?