How to format 2 numbers in power?
Example:
2, 2 = 2²
3, 2 = 3²
5, 3 = 5³
6, 2 = 6²
How to format 2 numbers in power?
Example:
2, 2 = 2²
3, 2 = 3²
5, 3 = 5³
6, 2 = 6²
The <sup>
HTML element can be used to place text in this form:
2<sup>3</sup>
Turns: 2 3 .
Alternatively, you can use Unicode characters for superscript (although only a few are supported):
2³
2³. In this case it would be necessary to map each number of 0
to 9
to its corresponding code point .
If you have this value in a string as you put it, you can do this:
var x = '2,5';
var partes = x.split(',');
var htmlString = partes[0] + '<sup>' + partes[1] + '</sup>';