how to round a number up to two last digits in javascript code example Example: javascript round to 2 digits var num = 2; var roundedString = num.toFixed(2);// 2.00