dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: AS2.0 printing decimal point

  1. #1
    Senior Member
    Join Date
    Dec 2004
    Posts
    101

    AS2.0 printing decimal point

    hello,

    as in C++ you may find a keyword called fixed and showpoint. i was wondering if anyone knows what this keywords would be in AS2.0?

    these two keywords basically allow to you to set a decimal point in numbers when printing or output.

    i know AS2.0 has the floatparcer method, but that is not quite what i am looking for,cuz i want it to stop at the .00 place.

    thank you
    Hector

  2. #2
    Senior Member
    Join Date
    Sep 2000
    Location
    Pittsburgh
    Posts
    252
    Hi Hector,

    would something like this do the trick?

    Code:
    function roundDec(num:Number, places:Number):Number{
    	var power = Math.pow(10, places);
    	var tempNum:Number = Math.round(num * power) / power;
    		return tempNum;
    }
    	
    var blah:Number = roundDec(65.54321, 2);
    trace(blah);
    dunc

  3. #3
    Senior Member
    Join Date
    Dec 2004
    Posts
    101
    sweet i give it a world.. thank you so much...

  4. #4
    Senior Member
    Join Date
    Dec 2004
    Posts
    101
    it worked like a charm thank you so much....

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