Announcement

Collapse
No announcement yet.

Math.floor(), Math.ceil(), Math.round() -- Help

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Math.floor(), Math.ceil(), Math.round() -- Help

    I am trying to figure out the trick to getting Math.floor(), Math.ceil(), and Math.round() to work. I verified with isNaN() and isFinite() that the variable is a number. However, debugPrint shows it as a float even after the Math.floor() call. It plots as a float and displays as an integer in the Cursor window. I want an integer to plot so that I can line up with the ticks.

    I've checked EFS Help and the JavaScript Reference. Any help would be appreciated.

  • #2
    Here is a line out of some of my code so you can check for syntax
    PHP Code:
    var i2Math.ceil(nSet1.length/L1); 
    If it is not obvious, I would try putting in numbers and see if it works, e.g. var i2= Math.ceil(3/2);

    Also check out this link
    Regards,
    Last edited by Guest; 12-21-2003, 06:21 PM.

    Comment


    • #3
      I tried what you suggested with Math.floor(3/7) to see what would happen. Of course it worked fine. Then I un-commented the previous code and it decided to start working. Got me. The wonders of computer programming.

      Thanks.

      Comment

      Working...
      X