SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Zealot ameerulislam's Avatar
    Join Date
    Jul 2011
    Posts
    145
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    calculator with jquery? does javascript support logarithm calculations?

    Hi,

    I have already built the tool with php, but now I was asked to build it dynamically I mean results will show up without the page being refreshed. My calculator produces effective value when nominal value is used as input and vice-versa.

    Will jQuery/javascript be able to do logarithm calculations?

    If not I think Ajax is the last solutions is it?

  2. #2
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    5,939
    Mentioned
    215 Post(s)
    Tagged
    12 Thread(s)
    JavaScript can do logarithm calculations.
    Check out the Math Object: https://developer.mozilla.org/en-US/...l_Objects/Math

  3. #3
    SitePoint Zealot ameerulislam's Avatar
    Join Date
    Jul 2011
    Posts
    145
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Pullo View Post
    JavaScript can do logarithm calculations.
    Check out the Math Object: https://developer.mozilla.org/en-US/...l_Objects/Math
    Thanks, @Pullo I found javacripts' round function only taking one parameter. I wanted to round to the nearest 3 digits and it seems this is not possible?

  4. #4
    SitePoint Zealot ameerulislam's Avatar
    Join Date
    Jul 2011
    Posts
    145
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Okay I found this one!!

    Code:
    Math.round(x*1000)/1000
    This is too clever maan..

    Quote Originally Posted by ameerulislam View Post
    Thanks, @Pullo I found javacripts' round function only taking one parameter. I wanted to round to the nearest 3 digits and it seems this is not possible?


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
  •