JSFiddle - React, Tailwind, and code Playground

JavaScript

var one = 1.0000
    var two = 1.1000
    var three = 1.1200
    var four = 1.1230
    
function tofixed(val)
{
   return val.toFixed(2);
}

console.log(tofixed(one));
console.log(tofixed(two));
console.log(tofixed(three));
console.log(tofixed(four));