Rounding function

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Jason, EViews Steve, EViews Moderator

jthodge
Posts: 77
Joined: Tue Oct 21, 2008 5:52 am

Rounding function

Postby jthodge » Thu Jun 17, 2010 7:35 am

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.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13312
Joined: Tue Sep 16, 2008 5:38 pm

Re: Rounding function

Postby EViews Gareth » Thu Jun 17, 2010 8:05 am

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.
Follow us on Twitter @IHSEViews

jthodge
Posts: 77
Joined: Tue Oct 21, 2008 5:52 am

Re: Rounding function

Postby jthodge » Thu Jun 17, 2010 9:04 am

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.

Katjes
Posts: 56
Joined: Thu Oct 02, 2008 5:46 am

Re: Rounding function

Postby Katjes » Wed May 02, 2012 6:47 am

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?

EViews Esther
EViews Developer
Posts: 149
Joined: Fri Sep 03, 2010 7:57 am

Re: Rounding function

Postby EViews Esther » Wed May 02, 2012 8:31 am

Following aforementioned suggestions, you can do

Code: Select all

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


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 20 guests