You can simply convert the number to a string, get the index of the decimal point, and use slice to remove all the characters after the first two characters after the decimal point.
function truncate(num){
var str = num.toString();
var idx = str.indexOf('.');
return idx != -1 ? str.slice(0, idx + 3): str;
}
console.log(0.99922312, "->", truncate(0.99922312));
console.log(0.8, "->", truncate(0.8));
console.log(0.121, "->", truncate(0.121));
console.log(0.235, "->", truncate(0.235));
console.log(12, "->", truncate(12));
If you need the truncated result as a number instead of a string, you can use the unary plus operator to convert it back to a number.
var truncatedNum = +truncate(num);