How to round down number 2 decimal places? [duplicate]

Use Math.floor to round the decimal places under the current value.

Reference

Example

Math.floor(1.0789 * 100) / 100

Working Fiddle

console.log(Math.floor(1.0789 * 100) / 100);
console.log(Math.floor(10.350 * 100) / 100);
console.log(Math.floor(1.7777 * 100) / 100);
console.log(Math.floor(12.34 * 100) / 100);

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)