I have a lot of data like this:
3.23214215
but I want to use part 3.2,
3.2
what can i do with jquery,
thank
yourNumber.toFixed(1);
https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number/toFixed
You can use simple Javascript:
var n = 3.23214215 var fixed = n.toFixed(1)
You don't need jquery, plain old javascript does the trick:
var chopped = Math.floor(full_length * 10.0) / 10.0;
You can do this in simple Javascript:
var f = 3.23214215; f *= 10; var i = parseInt(f); f = i / 10;
You can also explore the Math object. It may have a rounding function.