JSFiddle - React, Tailwind, and code Playground

by Julian Garcia Castillo

JavaScript

let n = "1.0"
let f = Math.round(n * 10) / 10
console.log(Number(f.toFixed(1)))