Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

advanced rounding

Lex Neva
wears dorky glasses
Join date: 27 Nov 2004
Posts: 1,361
01-16-2005 16:03
The math and string functions in LSL seem to be a little lacking. I just read a thread in which someone wanted to llSay a floating point number, and they were getting a ridiculous number of trailing zeroes (ie "1.200000000";). I understand this is due to floating point inaccuracy. A few LSL solutions were given:

/54/88/33090/1.html

I don't feel we should have to jump through hoops as all of the suggested code snippets did. I would like to see a more advanced version of llRound() that would be able to round to a certain decimal place, or better yet, a function that let us format numbers such as printf() does in C.
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
01-16-2005 22:46
boooo hoops :p
<approved>
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
- Cyril Connolly

Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence.
- James Nachtwey