Announcement

Collapse
No announcement yet.

Math Evaluating as Text

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

  • Math Evaluating as Text

    I have a math formula that is evaulating as text or so it would seem:

    stop1 = close() + range ;

    close() is 700.3
    range is 2.40

    stop1 is returning 700.32.40

    I'm looking for 702.70! hehe I've tried using parathensis but that didn't work either. Help

    P.S. Before this I used toFixed to convert range from 2.40385734738 to 2.40. Does this cause it to act as a string then? I need two decimal places. What other choices do I have? Now I can not preform math on the number?

    G
    Last edited by glay; 01-07-2007, 04:25 PM.

  • #2
    glay
    The .toFixed() method will convert a value to a string in which case JavaScript will concatenate the values.
    To convert a string to a number multiply it by 1 eg range*1
    Alex

    Comment


    • #3
      Ahhhhhh! That would of been simple. I used that toFloat command I saw on another post. It also worked as well.

      thx

      Comment

      Working...
      X