SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Evangelist ktown's Avatar
    Join Date
    May 2001
    Location
    toronto
    Posts
    478
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey!

    I'm have to add a lot of mathematical data to a table and i was wondering if html has a way of doing exponents?

    like x2(would be x-squared) - that sort of thing. I'm not sure if its even possible so any input would be fantastik.

    THX.

  2. #2
    I believe you have my stapler. scrubz's Avatar
    Join Date
    Feb 2001
    Location
    Van down by the river
    Posts
    254
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Do you mean doing calculations before the data is entered into the database? HTML won't do this, but JavaScript has a Math object. JavaScript could do the calculations and you could insert the results into the database.

  3. #3
    SitePoint Zealot oodie's Avatar
    Join Date
    Jul 2000
    Location
    Misty Mountain
    Posts
    125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think what you meant was writing exponents as superscript. Am I correct? If so, use <sup></sup> tag like this : x<sup>2</sup>
    HTH!

  4. #4
    ********* Callithumpian silver trophy freakysid's Avatar
    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    3,798
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, I just went and did a search on the Math object which has the method pow(x,y) which returns x to the power of y. Eg,

    number = Math.pow(2,3);

    will assign number the value of 8.

    I notice that all the document refers to the Math object but technically it appears to be a class with static methods (but that's a moot point)

  5. #5
    SitePoint Evangelist ktown's Avatar
    Join Date
    May 2001
    Location
    toronto
    Posts
    478
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    THX for the input everyone!

    actually oodie understood what i said... sorry - superscripts is is what i meant to say

    Cheers.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •