PDA

View Full Version : [MX] Rounding off numbers



Tomoko_Sasaki
February 15th, 2003, 11:29 AM
Hi, i've tried making a preloader (without any tutorials) by myself, i've done everything, just i've done this:

named text box varibal: loaded

on the maintimeline's first frame i enter:

loaded=_root.getbytestotal();

all i want to do now is round the bytes off to KB. i Assume you multiply by 1000 but where do i put this code? in the brackets? new line? or what. HELP!! :)

-Michelle

Jubba
February 15th, 2003, 11:36 AM
loaded = Math.round(_root.getBytesLoaded()/1000)

that should work.

Tomoko_Sasaki
February 15th, 2003, 11:45 AM
Originally posted by Jubba
loaded = Math.round(_root.getBytesLoaded()/1000)

that should work.

thanks alot, it worked perfectly.

Mr. Twinkles
February 21st, 2003, 01:02 AM
dunno if you're still working on this:
technically, you would need to multiply by 1024, not 1000. 1 kb is 1024 bytes. Not to be anal, but that's how it is.

senocular
February 21st, 2003, 06:39 AM
its been discussed
http://www.kirupaforum.com/showthread.php?s=&threadid=12157