dcsimg
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: limiting Decimals

  1. #1

    limiting Decimals

    OK, this one is prob' easy, I just keep overlooking it. I have a math function in a flash MC that returns a value. I want to express this value in dollars and cents, but I keep getting these long numbers like: 234.08268398262. I want to limit the number to just 2 decimal places, how do I do this?

    Thanks Guys
    "You see, it's like I said, you can more with a kind word and a 2x4 then you can with just a kind word."
    [swf width="300" height="40" background="#000000"]http://www.stormbuilt.com/iconlogo.swf[/swf]

  2. #2
    Young Senior Member mayhem_sci's Avatar
    Join Date
    Jun 2002
    Location
    Singapore
    Posts
    282
    you have to round it off: Math.round(value*100)/100;

  3. #3

    rounding

    Thanks, as you expexted, it worked great.

    Thanks again.
    "You see, it's like I said, you can more with a kind word and a 2x4 then you can with just a kind word."
    [swf width="300" height="40" background="#000000"]http://www.stormbuilt.com/iconlogo.swf[/swf]

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