How do you round to 1 decimal place in Javascript (roundup)?

Round to 1 decimal place in Javascript (roundup)

var number = 12.3456789;
var rounded = Math.round( number * 10 ) / 10;
// rounded is 12.3

The post How do you round to 1 decimal place in Javascript (roundup)? appeared first on WP Code Kit.

Leave a Reply

Your email address will not be published. Required fields are marked *