y2k_Byte Converter

by Y2kEric
Bytes <-> Kilobytes <-> Megabytes <-> Gigabytes <-> Terabytes <-> Petabytes <-> Exabytes <-> Zettabytes <-> Yottabytes
ID:129229
 
Demo: y2k_Byte Converter (Form Demo)

_Version Updates_

Version 1 (July 14, 2006) - First release!!
Version 2 (July 16, 2006) - y2k_Round(num,round_spaces) <---- Now rounds off instead of cutting off.
Version 3 (July 17, 2006) - y2k_Round(num,round_spaces) <---- Removed, does same thing as built-in round().
Added automated demos, just compile and run.
-------------------------------------------------------------------
_Proc Argument Explanation_

y2k_Byte_Converter(num=0,input="B",output="KB",SI=0,round_mu ltiple=0)

var/num - number you want to convert
var/input - byte type of num
var/output - determins the byte type of what to convert num to
var/SI - determins if it will use SI or Binary
var/round_multiple - determins nearest multiple of the outputed number to round to
set to 0 to round to nearest whole number <----- Default Action
set to 0.1 to round to nearest tenths
set to 0.01 to round to nearest hundredths
set to 0.001 to round to nearest thousandths
set to 0.0001 to round to nearest millionths
-------------------------------------------------------------------
_Proc Return Value Explanation_

y2k_Byte_Converter(num,input,output,SI,round_multiple)

Returns a /list object

var/DATA[0]
DATA["NUM"] - the converted number as a num
DATA["TEXT"] - the converted number as a text string
DATA["TYPE"] - the converted number's byte type Ex. B, KB, MB, ect.
-------------------------------------------------------------------