Page 1 of 1

Rounding function

Posted: Thu Jun 17, 2010 7:35 am
by jthodge
Is there a function for rounding a series to a certain number of decimal places? All I can find is @round(), which rounds to the nearest integer.

Re: Rounding function

Posted: Thu Jun 17, 2010 8:05 am
by EViews Gareth
I believe there isn't. I usually multiply by 100, then divide by 100, if you see what I mean.

I'll see if we can add one though, since it is quite ridiculous we don't have one.

Re: Rounding function

Posted: Thu Jun 17, 2010 9:04 am
by jthodge
Your suggestion sounds simple enough. For example, to round to four decimal places:

genr series02 = @round(10000*series01)/10000

A function similar to Excel's ROUND(series01,4) would be nice.

Re: Rounding function

Posted: Wed May 02, 2012 6:47 am
by Katjes
Hi, is there already a solution to round a value to certain decimal places.
In my case, I have to generate a third series from two series that are "rounded and reduced" to 2 decimal places.
Any suggestions?

Re: Rounding function

Posted: Wed May 02, 2012 8:31 am
by EViews Esther
Following aforementioned suggestions, you can do

Code: Select all

series third = (@round(series*100))/100