Zero disappears with round

For making suggestions and/or requests for new features you'd like added to EViews.

Moderators: EViews Gareth, EViews Moderator

pelleenglund
Posts: 24
Joined: Fri Sep 16, 2016 6:35 am

Zero disappears with round

Postby pelleenglund » Tue Jun 26, 2018 4:21 am

Hi,

I wonder if there is a way that I can get the zero to show upp when using @round with one decimal? To illustrate what I mean, this code will prompt up 2, but I would like 2.0.

!i = 2.04
!j = @round(!i, 1)
@uiprompt(@str(!j))

Best regards,
Pelle

EViews Matt
EViews Developer
Posts: 560
Joined: Thu Apr 25, 2013 7:48 pm

Re: Zero disappears with round

Postby EViews Matt » Tue Jun 26, 2018 8:58 am

Hello,

You can use the optional second argument to @str to specify a format for the resulting string, including how may digits should appear to the right of the decimal point. I believe what you're asking for is accomplished with @str(!j, "f.1").

pelleenglund
Posts: 24
Joined: Fri Sep 16, 2016 6:35 am

Re: Zero disappears with round

Postby pelleenglund » Wed Jun 27, 2018 12:16 am

Oh missed that argument, thanks a lot!


Return to “Suggestions and Requests”

Who is online

Users browsing this forum: No registered users and 19 guests