Hi Tom,

You can use below expression:

void ceil(real a)
{
    return (trunc(a) == a ? a : trunc(a)+1);
}

Ali Ihsan Agca


--- In Axapta-Knowledge-Village@yahoogroups.com, "Tom Scott" <tom.sc...@...> 
wrote:
>
> Hi, I was wondering if there is a "ceiling" (i.e. round up) function in X++. 
> I have tried playing with the round() function but I haven't managed to make 
> it behave as I want it.
> I want to round up to the nearest integer, i.e.:
> 
> a = 5.2;
> b = 5.5;
> c = 5.0;
> 
> ceiling(a) = 6
> ceiling(b) = 6
> ceiling(c) = 5
> 
> It would be fairly simple to write my own, but I don't want to make extra 
> work for myself if it's been done already...
> 
> Tom
>


Reply via email to