I have numbers in table and need to format them with JavaScript (2 symbols after dot). This code works but I guess there are more efficient and elegant ways:
var str = "126389471.74000001";
var dotIndex = str.indexOf(".");
var formattedStr = str.substring(0, dotIndex+3);
Could anybody suggest better solution?