round utility functions

add mRoundF to return nearest floating value to stepsize
This commit is contained in:
AzaezelX 2024-04-10 14:17:19 -05:00
parent f0e7a27c16
commit f7ed077d82
4 changed files with 27 additions and 24 deletions

View file

@ -103,6 +103,14 @@ DefineEngineFunction( mRound, S32, ( F32 v ),,
"@ingroup Math" )
{
return mRound(v);
DefineEngineFunction(mRoundF, F32, (F32 v, F32 step), ,
"Round v to the nth decimal place or the nearest whole number by default."
"@param v Value to roundn"
"@return The rounded value as a F32."
"@ingroup Math")
{
return mRoundF(v, step);
}
DefineEngineFunction(mRoundDelta, S32, (F32 v, S32 d), (0.0, 1),