JSFiddle - React, Tailwind, and code Playground
HTML
<input type="text" id="newcolor" />
JavaScript
jQuery(document).ready(function($) {
$('#newcolor').val('0');
function cent(amount) {
amount -= 0;
amount = (Math.round(amount*100))/100;
return (amount == Math.floor(amount)) ? amount + '.00' : ( (amount*10 == Math.floor(amount*10)) ? amount + '0' : amount);
}
var hueVariation = cent(1.73540012511); // I need integer deleted, and round to 3 or 4 places .7354
$('#newcolor').val(hueVariation);
});