Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Formatting limits

    Hello Everyone,

    I am interested in learning why Stata is behaving the following way:

    Code:
    . list lati in 1/10
    
         +-------+
         |  lati |
         |-------|
      1. | 25.34 |
      2. | 25.34 |
      3. | 25.35 |
      4. | 25.34 |
      5. | 25.34 |
         |-------|
      6. | 25.34 |
      7. | 25.34 |
      8. | 25.34 |
      9. | 25.34 |
     10. | 25.34 |
         +-------+
    
    . format lati %100.20f
    
    . list lati in 1/10
    
         +-------------------------+
         |                    lati |
         |-------------------------|
      1. | 25.34061000000000200000 |
      2. | 25.33968000000000100000 |
      3. | 25.34695397000000100000 |
      4. | 25.34380006000000000000 |
      5. | 25.34368666666669900000 |
         |-------------------------|
      6. | 25.34113666666669900000 |
      7. | 25.34065500000000200000 |
      8. | 25.33985666666670200000 |
      9. | 25.34201666666670100000 |
     10. | 25.34385166666670100000 |
         +-------------------------+
    
    . format lati %100.50f
    
    . list lati in 1/10
    
         +------+
         | lati |
         |------|
      1. |   25 |
      2. |   25 |
      3. |   25 |
      4. |   25 |
      5. |   25 |
         |------|
      6. |   25 |
      7. |   25 |
      8. |   25 |
      9. |   25 |
     10. |   25 |
         +------+
    Specifically, if I request MORE of the fractional digits, I don't expect Stata to start showing LESS than it was showing earlier!

    50 is just an example here, I believe the limit is smaller. However, help format that I tried to scout for the answer is not revealing the ranges for X and Y in %X.Yf formats. Perhaps there is a spot that I've missed or another source somewhere.

    Note that 100 should be legal, as it determines the width of the column in the list's output when the numeric column has value labels attached.

    (observed in Stata 14/Windows, though I don't expect this to be version specific).

    Thank you, Sergiy Radyakin


Working...
X