Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

Re: st: How to convert number format


From   "Richard J. Stoll" <[email protected]>
To   [email protected], [email protected]
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 * [email protected] * 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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index