Announcement

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

  • Format Thousand Separator (Positive and Negative values)

    Hi,

    I am currently have problem on formatting my stata variable similar to excel thousand separator, my dta look like:

    recapneraca_value PERIOD
    -3019225115333 2016m11
    1674995838303 2016m11
    -2.91e+11 2017m1
    2.00e+11 2017m1

    I want to change it to:

    recapneraca_value PERIOD
    -3.019.225.115.333 2016m11
    1.674.995.838.303 2016m11
    -290.715.729.191 2017m1
    199.930.357.103 2017m1

    I try various formatting i.e:

    Code:
    format recapneraca_value %9.2fc
    format recapneraca_value %15.2f
    format recapneraca_value %15.0fc[/HTML]
    format recapneraca_value %9.0gc
    table recapneraca_value, format(%9.0f)
    last command result==> too many values r(134);

    but dont success.

    Any help is really appreciated. Thank you.

    FYI:
    I am using STATA 15.1 for Windows (64-bit)
    Windows 10 Pro
    Last edited by rudi sulistyo; 05 Jun 2018, 21:42.

  • #2
    Table can handle only so many values, and you have too many. So this is not a problem with format, but a problem with table. Now, a table with that many values is not meaningful, so it is probably not really what you want to do with that variable. In order to help you we need to know what you want to do with that variable.
    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment


    • #3
      Thank you for the reply.

      here what i want to deal with:
      .
      recapneraca_value
      -3019225115333
      1674995838303
      -2.91e+11
      2.00e+11
      .
      .
      i want to format it to become:
      .
      .
      recapneraca_value
      -3.019.225.115.333
      1.674.995.838.303
      -290.715.729.191
      199.930.357.103
      .
      as seen above, it has thousand separator period/comma.

      however when i try using
      Code:
       format recapneraca_value %15.0fc

      only some of number has thousand separator.

      hopefully it can clear what my problem is.
      Last edited by rudi sulistyo; 06 Jun 2018, 03:06.

      Comment

      Working...
      X