"floor- Returns the rounded value of val to specified precision (number of digits after the decimal point). precision can also be negative or zero (default). "
Yes Debug 8889.0/1000 gives the same result, but I though the Procedure was supposed to round 8.8888 to 3 places. That would be 8.889. Otherwise it would be better to convert to a string to show the result where StrD(8889/1000,3) or StrD(8.8888,3) give the correct answer without bothering with a procedure .
Mike.
(I'm never going to catch up with the improvements to this program)
MikeB wrote:Yes Debug 8889.0/1000 gives the same result, but I though the Procedure was supposed to round 8.8888 to 3 places. That would be 8.889. Otherwise it would be better to convert to a string to show the result where StrD(8889/1000,3) or StrD(8.8888,3) give the correct answer without bothering with a procedure .
Yes, but i think that is not a clean solution.
I don't find a clean and elegant solution for it.
"floor- Returns the rounded value of val to specified precision (number of digits after the decimal point). precision can also be negative or zero (default). "
Where does this definition come from? That's not what FLOOR usually does.
FLOOR(x) will usually round toward -infinity so FLOOR(8.888) should be 8.
If you're going to have some specified digits after the point then I'd expect FLOOR(8.888,2) to give 8.88 and FLOOR(-8.888,2) to give -8.89
Usually ROUND rounds to nearest, CEIL rounds up and FLOOR rounds down.
FLOOR is not ROUND.
I saw the definition in the coding questions forum. I agree, it's not the correct function name, but I couldn't think of something better as Round() is already taken by PB.
Trond wrote:I saw the definition in the coding questions forum. I agree, it's not the correct function name, but I couldn't think of something better as Round() is already taken by PB.