a10cf76ef5
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13263 a95241bf-73f2-0310-859d-f6bbb57e9c96
14 lines
197 B
C++
14 lines
197 B
C++
#include "Utility.h"
|
|
#include <math.h>
|
|
|
|
float round(float n, int32 max)
|
|
{
|
|
max = (int32)pow(10, (float)max);
|
|
|
|
n *= max;
|
|
n += 0.5;
|
|
|
|
int32 tmp = (int32)floor(n);
|
|
return (float)tmp / (max);
|
|
}
|