javascript convert letter to number code example
Example 1: javascript letters as number
const toChars = n => `${n >= 26 ? toChars(Math.floor(n / 26) - 1) : ''}${'ABCDEFGHIJKLMNOPQRSTUVWXYZ'[n % 26]}`;
// Examples
toChars(0); // A
toChars(1); // B
toChars(25); // Z
Example 2: convert string to number javascript
var myString = "869.99"
var myFloat = parseFloat(myString)
var myInt = parseInt(myString)