First you could name your thread a bit more "on-topic" (e.g. "How to round numbers?")

-------------------------------------------------------------------

You can build a function yourself using "int" (wdl) or "integer" (lite-c)

Hummel posted this:

Quote:

function round(x) { return(integer(x+0.5)); } ^^so muss das aussehen.

nein-halt!
->so hier: function round(x) { return(integer(x+0.5*x/abs(x))); }
...denn sonst funzts nicht mit negativen Zahlen^^




I think you can change it a bit so that you can select the decimal point..

Try this:

function round(var x, var decimal)
{
x *= 10*decimal;
x = integer(x+0.5*x/abs(x));
x /= 10*decimal;
return(x);
}
(wdl)

function round(x,decimal)
{
x *= 10*decimal;
x = int(x+0.5*x/abs(x));
x /= 10*decimal;
return(x);
}
(lite-c)

Of course aou can shorten this script.
Be careful with large numbers.

(--> I did not try the script)