7
How to format 2 numbers in power?
Example:
2, 2 = 2²
3, 2 = 3²
5, 3 = 5³
6, 2 = 6²
7
How to format 2 numbers in power?
Example:
2, 2 = 2²
3, 2 = 3²
5, 3 = 5³
6, 2 = 6²
9
The HTML element <sup>
can be used to put a text in this form:
2<sup>3</sup>
Vira: 23.
Alternatively, you can use the unicode characters for superscript (although only a few of them are supported):
2³
2³ In this case it would be necessary to map each number of 0
to 9
to his code point correspondent.
5
If you have this value in a string as you put it can do so:
var x = '2,5';
var partes = x.split(',');
var htmlString = partes[0] + '<sup>' + partes[1] + '</sup>';
Browser other questions tagged html
You are not signed in. Login or sign up in order to post.
You speak of calculate a power or format a number as power?
– mgibsonbr
format a number as power!!!
– Alan PS
Formatting numbers is not a javascript problem. it is an HTML problem
– hugomg
how to format by html in potential ? remembering that I have this number for example "2,2" and need to turn "2²"
– Alan PS
This DIT of yours with the second question changes the question. I’ll go back, if you don’t agree say, or ask another question...
– Sergio
I asked you a new question......
– Alan PS