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

st: RE: Displaying values less than one with a zero in front of the comma


From   "Steichen, Thomas J." <SteichT@rjrt.com>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: Displaying values less than one with a zero in front of the comma
Date   Mon, 21 Feb 2005 13:10:50 -0500

My experience is that 
g formats do not put the leading zero 
f formats        put the leading zero
Thus:

.. format var2 %9.1f
.. desc

Contains data
  obs:             6                          
 vars:             2                          
 size:            72 (99.9% of memory free)
-------------------------------------------------------------------------------
              storage  display     value
variable name   type   format      label      variable label
-------------------------------------------------------------------------------
var1            float  %9.0g                  
var2            float  %9.1f                  
-------------------------------------------------------------------------------
Sorted by:  
     Note:  dataset has changed since last saved

.. l

     +-------------+
     | var1   var2 |
     |-------------|
  1. |    1    1.0 |
  2. |    1    1.0 |
  3. |    2    2.0 |
  4. |    2    2.0 |
  5. |   .1    0.1 |
     |-------------|
  6. |   .1    0.1 |
     +-------------+

.. 


Thomas J. Steichen
steicht@rjrt.com
----------------------------------------------------------------------------
  Facts do not cease to exist because they are ignored. - Aldous Huxley
----------------------------------------------------------------------------



> -----Original Message-----
> From: owner-statalist@hsphsun2.harvard.edu 
> [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Seb Buechte
> Sent: Monday, February 21, 2005 12:39 PM
> To: statalist@hsphsun2.harvard.edu
> Subject: st: Displaying values less than one with a zero in 
> front of the comma
> 
> 
> Dear all,
> 
> is there anyway to force stata to generally display 0.5 
> instead of .5 ? 
> 
> I do not think that setting a fixed format with leading zeros 
> like %08.2 is really the solution. Many times I just do not 
> know in advance wether my calcs will return  values  less 
> than 1 and greater than -1...I appreciate you help!
> 
> Kind regards,
> Sebastian
> 
> 
> -- 
> - Seb F Buechte
> -
> - Stay in touch!
> *
> *   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/
> 

-----------------------------------------
CONFIDENTIALITY NOTE:  This e-mail message, including any  attachment(s),
contains information that may be confidential,  protected by the attorney-
client or other legal privileges, and/or  proprietary non-public
information.  If you are not an intended  recipient of this message or an
authorized assistant to an intended  recipient, please notify the sender by
replying to this message and  then delete it from your system.  Use,
dissemination, distribution,  or reproduction of this message and/or any of
its attachments (if  any) by unintended recipients is not authorized and
may be unlawful.


*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index