![]() |
Exponent numeric display.
Hello, I would like to apologize in advance for the somewhat weird english I'm going to write.
The problem is as follows, I need to make a program in javascript that creates a random monomial and then you have to solve it. My isse is, how can I make the exponent look like the normal small number, for example: This is how my exercise is shown: -18x2 when x is -54 I want it to show it like this: -18x˛ when x is -54 Any help would be greatly appreciated. |
Code:
-18x<sup>2</sup> |
Quote:
Sorry for the rather stupid question... |
Code:
var str = "-18x"“The expert at anything was once a beginner” |
Quote:
(monomial.exponent).sup |
Quote:
sup() is an inbuilt Javascript method which is used to display a string as superscript text. My example shows how to apply that to the exponent (i.e. squared). You can use the split() method to divide a number with exponent into its parts- Code:
<script type = "text/javascript"> |
I think he just misused terminology, Philip.
I think he has an object, referenced by the variable monomiial (or maybe Monomio--he uses different names in different posts) and that object has a property named exponent (or maybe grado--again, different names in different posts). SO I think the answer is "yes". I think if he simply uses monomial.exponent.sup() (or maybe it is Monomio.grado.sup()??) it will work.It will not work as he showed it: (monomial.exponent).sup because he omitted the () after sup. |
| All times are GMT +1. The time now is 02:32 PM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.