>it's work...!!
>thanks for your help..
>by the way, i hope that someday there will be a function for this..
I doubt it, since your requierements are very specific (most people don't want this kind of rounding).
You can easily create your own function (UDF). I am including the function - which is fairly simple - and a test program. Put the function wherever it is easily accesible (see: SET PROCEDURE).
So, from now on, instead of using round(Number, 2), which doesn't give the results you desire, you can use RoundUp(Number ,2).
In general, you can create your own custom functions (and classes, too) for specific behaviour you need over and over again.
However, in this particular case, please note that the behaviour of the round() function is what many people expect - you should use RoundUp() only in very specific cases.
clear
? RoundUp(4.1, 0)
? RoundUp(4.01, 1)
? RoundUp(4.99, 1)
? RoundUp(5, 1)
? RoundUp(pi(), 2)
? RoundUp(15123, -3)
function RoundUp(tnNumber, tnDecimals)
return ceiling(tnNumber * 10^tnDecimals) / 10^tnDecimals
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)