Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: How to convert number format


From   "Richard J. Stoll" <stoll@rice.edu>
To   statalist@hsphsun2.harvard.edu, stoll@rice.edu
Subject   Re: st: How to convert number format
Date   Fri, 04 Nov 2011 01:06:18 -0500

On 11/3/2011 10:52 PM, James Sams wrote:
Given the variable is called v2, i think this will do the trick. Only tested
with positive numbers.

replace v2 = v2/10^(floor(log10(v2))-2) if v2>= 1000

You can have credit for Poli 211.

--
-----------------------------------------------------------------
Richard J. Stoll * Albert Thomas Professor of Political Science *
Rice University * Political Science MS 24 * P.O. Box 1892 * Houston
TX 77251-1892 * stoll@rice.edu * 713-348-3362 * FAX: 713-348-5273
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index