Fixed Precision

From Second Life Wiki
Jump to navigation Jump to search

Here's a function to do fixed precision.

string fixedPrecision(float input, integer precision)
{
    if(precision < 7)
        return llGetSubString((string)input, 0, precision - 7 - !precision);
    return (string)input;
}