JSFiddle - React, Tailwind, and code Playground

JavaScript

var x = 300.239235;
console.log(x.toFixed(2)); //300.23