Author Topic: Rounding off to 0 Dec  (Read 210 times)

Offline kgcognos

  • Community Leader
  • *****
  • Join Date: Oct 2013
  • Posts: 100
  • Forum Citizenship: +0/-1
Rounding off to 0 Dec
« on: 19 Sep 2018 09:53:34 am »

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.


Offline khayman

  • Statesman
  • ******
  • Join Date: Jun 2009
  • Posts: 436
  • Forum Citizenship: +25/-3
    • CognosM
Re: Rounding off to 0 Dec
« Reply #1 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