Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: help on round function


From   <[email protected]>
To   <[email protected]>
Subject   RE: st: help on round function
Date   Sat, 10 Dec 2005 16:24:38 -0500

Fred,
I got that. But if I have a variable
X
8.575
7.995
10.324
and I do: gen y =round(x,.01), I get
Y       not  Y
8.57		8.58
7.99		8.00
10.32		10.32

what I need. What am I doing wrong?

Thanks,
Pinaki Mitra 
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Fred Wolfe
Sent: Saturday, December 10, 2005 3:44 PM
To: [email protected]
Subject: Re: st: help on round function

At 01:26 PM 12/10/2005, you wrote:
>Hello List,
>
>How do I use the round function to round off 8.755 to 8.76, 8.754 to
>8.75?


. di round(8.755,.01)
8.76
[MITRA PINAKI ] 8
. di round(8.754 ,.01)
8.75

Fred Wolfe

>Thanks,
>Pinaki Mitra
>
>*
>*   For searches and help try:
>*   http://www.stata.com/support/faqs/res/findit.html
>*   http://www.stata.com/support/statalist/faq
>*   http://www.ats.ucla.edu/stat/stata/


Fred Wolfe
National Data Bank for Rheumatic Diseases
Wichita, Kansas
Tel (316) 263-2125     Fax (316) 263-0761
[email protected]


*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index