function Round(%num){ if(%num - mFloor(%num) < 5) return mFloor(%num); else return mCeil(%num); }
function Round(%num){ %floor = %num - mFloor(%num); %ceil = %num - mCeil(%num); if(%floor >= mAbs(%ceil)) return mCeil(%num); else return mFloor(%num);}
5? Why 5? Here's how I would do it:
mFloatLength(%num,0)
function Round? Why function Round? Here's how I would do it:Code: [Select]mFloatLength(%num,0)
Well, yes, but I was just showing him how I would make my own round function.
...?Code: [Select]function Round(%num){ return mFloatLength(%num,0);}
function Round(%num){ return mFloatLength(%num,0);}
That doesn't round numbers...
function mRound(%num){return (%num - mFloor(%num) < 0.5) ? mFloor(%num) : mCeil(%num);}