Search content:

 

Personal Menu
Username:
Password:
Save password

Become a member

Forgot Password?

 

Don't miss these
Volume Control-Button Only
Roil-Alphamania
ActiveX Web controler
Dress Up
free MD5 hashing Xtra
VideoCodecCheck II
Seurat-Alphamania
Set Color properties of a vector cast member
Data Linker Xtra
Move sprite along mouse vector Behavior
MediaMacros Xtras Mall
 

 

 

Behavior Round floating point numbers off to nearest ten

Added on 11/8/2005

 

Compatibilities:

This item has not yet been rated

Author: psykopath (website)

Round off floating point numbers to the nearest ten. Does not work with integers

on roundOff num
  tempFP = the floatPrecision
  numString = string(num)
  --put "original number:"&&numString
  repeat with i = 0 to tempFP
    tot = numString.char.count
    --put "deleting char:"&&numString.char[tot]
    delete char tot of numString
  end repeat
  tot = numString.char.count
  dependent = numString.char[tot]
  --put "dependent is:"&&dependent
  dependent = integer(dependent)
  if dependent>=5 then
    dif = 10-dependent
    myNum = integer(numString)+dif
  else
    myNum = integer(numString)-dependent
  end if
  return myNum
end

 


Upload Provided by ABCUpload ASP

Contact

MMI
22 West Court Sq
Suite 2C
Newnan, GA 30263
USA

Fax - (206) 339-5833

Send e-mail