Suppose I have a value of 15.7784514, I want to display it 15.77 with no rounding.
var num = parseFloat(15.7784514); document.write(num.toFixed(1)+\"
Here is what is did it with string
export function withoutRange(number) { const str = String(number); const dotPosition = str.indexOf('.'); if (dotPosition > 0) { const length = str.substring().length; const end = length > 3 ? 3 : length; return str.substring(0, dotPosition + end); } return str; }