Guys I'm working on a native script project
I'm hitting an API and in response, I'm getting the rating of restaurants. Like[3.75, 3.57, 4.6]
What I want to do is, remove values after decimals whether it's precision scale is 1 or 2 or any
Currently I'm trying it with
parseFloat(3.75).toFixed(2)
But I'm getting 3.75
as it is.
Any idea how can I fix it?
var v = parseFloat(3.75).toFixed(2);
console.log(v);