COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: kgcognos on 19 Sep 2018 09:53:34 AM

Title: Rounding off to 0 Dec
Post by: kgcognos on 19 Sep 2018 09:53:34 AM
Hi,

I have a data item containing a sales$ with 2 decimals.
I just want to display on the screen as a whole number.
And use the whole number in the percent calculation.

I set up the data item to round(sales$,0)
But this is still displaying the dec on the screen. ie  100.50 instead of 101
Also, it is using 100.50 in the percent calculation, instead of 101

Please help how to resolve. I can format to display with 0 decimal but this only fix the display. I need the percent calculation to use the whole number.
Thank you in advance.

 
Title: Re: Rounding off to 0 Dec
Post by: Francis aka khayman on 12 Mar 2019 01:59:15 PM
displaying a number is a different animal from using that number in a calculation. if you want to display without decimal, you might want to set the Data Format properties.

if you want to use decimal in calculation you might want to use ceiling or floor functions beforehand