Strings In Depth13 / 18
Up next

Convert to and from numbers

const n = 3.14159;
// toFixed returns a string with fixed decimals
console.log(n.toFixed(2));
const asText: string = String(42);
const asNum: number = Number("42");
console.log(asText, asNum);
What you're solving

String, Number, and toFixed