A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: trying to get rid of the decimals...

  1. #1
    Senior Member flipsideguy's Avatar
    Join Date
    Dec 2000
    Location
    Sweden
    Posts
    834
    Code:
    onClipEvent (load) {
        total = _root.getBytesTotal() + " bytes";
    }
    onClipEvent (enterFrame) {
        download = _root.getBytesLoaded() + " bytes";
        bytesleft = _root.getBytesTotal()-_root.getBytesLoaded()+" bytes";
        percent = _root.getBytesLoaded()/_root.getBytesTotal()*100+"%";
        if (percent == "100%") {
            _root.gotoAndPlay( 2 );
        }
    }
    This is the code I'm using in my preloader (got it from a tutorial). But this code shows the numbers with like 6 decimals. How do you get rid of the decimals?
    Thank you for your replies!

  2. #2
    9th Grade WC
    Join Date
    Sep 2000
    Posts
    1,192
    try setting the variable that has the decimal numbers to fixed variable = blah;
    or
    int variable = blah;

  3. #3
    Member
    Join Date
    Mar 2001
    Posts
    31
    you can always use the Math.floor function ..

  4. #4
    Senior Member flipsideguy's Avatar
    Join Date
    Dec 2000
    Location
    Sweden
    Posts
    834
    How would you put any of those codes into the exisiting script?


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