A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: problem with needing a double value

  1. #1
    Ryan :D ryanp321's Avatar
    Join Date
    Nov 2007
    Location
    Wallasey
    Posts
    292

    problem with needing a double value

    hey,
    i'm bascily inputting a number into a textboxes called dividedbycd and multipercent, it's messy with variable names as i've been rushing this all today.
    but latestVar is basicly a large number value which needs to be divided by a number, which could be either integer or a decimal value (dividedbycdfn) then multiplied by a percentage, so just a decimal value really like 0.85 for example.

    Throughout what i'm doing (as i'm very uneasy with as3) is turning integers into strings to output in textboxes. which is fine, but i can't figure how to do decimal values. Help with this would be great


    I've supplied the code (Which works)
    But only if I use integers. Thanks for anyhelp!

    Code:
    var taktTimeVar:Number = (((latestVar)/dividedByCdFn))*(multiPercentFn);
    taktTime.text = String(taktTimeVar);
    
    var taktTimeVar2:int = ((taktTimeVar)*60);
    inSeconds.text = String(taktTimeVar2);
    Ryan :]

  2. #2
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    What do you get when you use Number instead of int?
    - The right of the People to create Flash movies shall not be infringed. -

  3. #3
    Ryan :D ryanp321's Avatar
    Join Date
    Nov 2007
    Location
    Wallasey
    Posts
    292
    thank you very much!
    that did the trick
    Ryan :]

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center