Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Rounding number


From   "Joseph Coveney" <[email protected]>
To   "Statalist" <[email protected]>
Subject   Re: st: Rounding number
Date   Mon, 3 Mar 2008 22:37:57 +0900

Ziad El-Khatib wrote:

Hi STATA lister, tried to look for help round but did not understand it
well.
how to round variable (weight) to have it 0 decimal, e.g. 5 instead of 4.20?
--------------------------------------------------------------------------------

If the help for -round()- reads difficultly at first, then it helps to play
with the function to get to know it better.  It won't round 4.20 up to 5,
however.  I've used -display- below, but it requires -generate- to see what
really goes on with -round()-.

. display round(4.2, 1)
4

. display ceil(4.2)
5

Joseph Coveney


*
*   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