Why not `Math.ceil(newScale * 10) / 10` instead (same below)? Much easier to read, and most importantly avoids rounding issues due to limited numeric precision. (With your code, a scale value might for instance become 0.6000000000000001)