From: someone
Lets say you imput 1.58473 and 3
Your saying that the result will be 1.585, however, because it is a float, the result may as well be:
1.58499999999 or 1.5850000012
No, the result would be 1.585. Because the server would be:
1. Rounding, until..
2. the precision decimal place is met.
You couldn't get 1.5850000012 from 1.58499999999. Nine does not round to two, nor to one.. well unless I'm doing the math, in which case anything is possible!
Wed has a point in having it return a string, as this is when such a function would be used. I know it's not hard to script, cuz I do it already. Just why have the script handle it when it could be a function (and I'd think an easy one to implement).
I use rounded/precision floats in a number of different things, and a scripted function that gives a precision isn't, I'd think, as efficient as an LSL function would be.
Bos
Edit: Opps just re-read your post Chris, I used the wrong value and I see what you're saying -- but still, given 1.587..whatever the number is, can't see your post when editing my reply).. anyway no matter what the value is, it's rounding the value you input.
1.23456
even if it uses 8 decimal places (1.23456000), it wouldn't round the zeros, it'd start at the "6". Unless it was poorly coded anyway to round zeros (assuming it tacks them on) to anything other than another zero.
If I input a float of "1.23456", and LSL doesn't consider that the value is:
1.23456000000...infinite_zeros
..then something is wrong with the code.