haiku/src/preferences/screen/Utility.cpp
Axel Dörfler a10cf76ef5 Renamed src/prefs to "preferences", as the directory is usually called in BeOS.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13263 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-06-24 15:57:12 +00:00

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);
}