1

I want to round 1.7976 to 1.8. I've tried Math.round() and Math.float() but both give me 2 instead of what I want.

Bryan
  • 141
  • 1
  • 9

1 Answers1

-1

var number = 1.7976;
var rounded = Math.round( number * 10 ) / 10;
console.log(rounded);
Jerome
  • 734
  • 1
  • 8
  • 28