JSFiddle - React, Tailwind, and code Playground by Julian Garcia Castillo October 21, 2021 JavaScript let n = "1.0" let f = Math.round(n * 10) / 10 console.log(Number(f.toFixed(1)))