I have a float x that can be any size and need to increment its amount by 1 on the last zero, so .1 for 1.0, .01 for 2.00, etc.
The following code works for certain numbers, but not all:
Javascript
let a = "0".repeat(floatNumber.length-2)+'1';
let position = floatNumber.indexOf(".");
let add = [a.slice(0, position), ".", a.slice(position)].join('');
1.1 becomes 1.2.
but
10.1 becomes 10.20. I need an output of 10.2.