13 November 2019

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

No comments:

Post a Comment

How to create video slider with cuncks of videos without download all videos?

 Create video slider with cuncks of videos without download all videos function custom_video_slider_shortcode() { $slider_id = 'vide...