how to get number upto 2 decimal places in javascript code example Example: js number 2 decimal places (3.141596).toFixed(2); // 3.14