Announcement

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

  • Display Format--exclude decimals & include comma as thousand separator

    Which display format would exclude decimals, and use comma as thousand separator? For example, in the following table I want to see 99657871.28 as 99,657,871
    Code:
    . list in 10/14
    
         +------------------------------------------------------+
         |                        name    net_income   category |
         |------------------------------------------------------|
     10. |          UNIBAIL RODAMCO SE   99657871.28       Weak |
     11. |                ANAREN, INC.        786487   Dominant |
     12. |                  FRENCH PLC    1122589.71   Dominant |
     13. |              FURAMA LIMITED    3240460.34   Dominant |
     14. | GUARDIAN ROYAL EXCHANGE PLC      89719680       Weak |
         +------------------------------------------------------+
    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input str244 name double net_income str8 category
    "BRYANT GROUP PLC"                                 22147620 "Dominant"
    "FLORIDA PROGRESS CORPORATION"                    1.816e+08 "Weak"    
    "MUNKSJO AB (OLD)"                                 23847792 "Dominant"
    "NACCO INDUSTRIES, INC."                           30947000 "Dominant"
    "OLSTEN CORPORATION (THE)"                         12403000 "Dominant"
    "PEOPLES ENERGY CORPORATION"                       69655000 "Weak"    
    "ROLFE & NOLAN PLC"                              1215124.41 "Dominant"
    "SUNAMERICA INC."                                  38767000 "Weak"    
    "TOYOTA INDUSTRIES CORPORATION"                    99002800 "Dominant"
    "UNIBAIL RODAMCO SE"                            99657871.28 "Weak"    
    "ANAREN, INC."                                       786487 "Dominant"
    "FRENCH PLC"                                     1122589.71 "Dominant"
    "FURAMA LIMITED"                               3240460.3397 "Dominant"
    "GUARDIAN ROYAL EXCHANGE PLC"                      89719680 "Weak"    
    "KYOWA ELECTRONIC INSTRUMENTS COMPANY LIMITED"  -3182765.49 "Dominant"
    "OAK CAPITAL CORPORATION"                        2536549.38 "Dominant"
    "PHH CORPORATION"                                  47079000 "Dominant"
    "REACH PLC"                                     16942066.24 "Dominant"
    "SUMITOMO CHEMICAL CO LIMITED"                    161217270 "Dominant"
    "T. RAD COMPANY LIMITED"                         6718793.58 "Dominant"
    end

  • #2
    Format the variable before displaying the list.
    Code:
    format net_income %13.2fc
    Red Owl
    Stata/IC 15.1, Windows 10 (64-bit)

    Comment


    • #3
      It still includes the decimals; how do I exclude them?

      Comment


      • #4
        Code:
        format net_income %13.0fc

        Comment


        • #5
          Thank you William Lisowski! It does the job.

          Comment

          Working...
          X