If you are unable to create a new account, please email support@bspsoftware.com

 

How to round a value of 4.53% to 4% using Report studio in cognos 10?

Started by Rohini Suryawanshi, 29 Sep 2016 02:57:28 AM

Previous topic - Next topic

Rohini Suryawanshi

Hi,

How to round a value of 4.53% to 4 %,  4.44% to 4% using Report studio in cognos 10?

As, I have tried to use round function but it rounds a value in such a way like, 4.53% to 5% and 4.44% to 4%. But I dont want in this way.
Even I tried to use trunc function, but it is giving some unexpected result like 0.00% for 4.53%, 0.00% for 4.44%. Please suggest for the same.



Regards,
Hermoine Granger


MFGF

Quote from: Rohini Suryawanshi on 29 Sep 2016 02:57:28 AM
Hi,

How to round a value of 4.53% to 4 %,  4.44% to 4% using Report studio in cognos 10?

As, I have tried to use round function but it rounds a value in such a way like, 4.53% to 5% and 4.44% to 4%. But I dont want in this way.
Even I tried to use trunc function, but it is giving some unexpected result like 0.00% for 4.53%, 0.00% for 4.44%. Please suggest for the same.



Regards,
Rohini Suryawanshi

Hi,

You could try using the floor() function - this ought to give you what you need.

Cheers!

MF.
Meep!

dax

Take a look at the Floor function.  It rounds numbers down to the nearest integer so you might have to do some arithmetic to get it working e.g.

floor([Your calculation or data item]*100)/100

Dax

Edit: Too slow :)

MFGF

Quote from: dax on 29 Sep 2016 03:26:12 AM
Take a look at the Floor function.  It rounds numbers down to the nearest integer so you might have to do some arithmetic to get it working e.g.

floor([Your calculation or data item]*100)/100

Dax

Edit: Too slow :)

Lol. Unless you can type at the speed of a bullet train, I posted my answer as you were finishing up yours. It's far better to get two answers that agree than two that contradict, and in fact your answer has much more useful detail than mine. :)

Cheers!

MF.
Meep!

Rohini Suryawanshi