Announcement

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

  • Code for inserting currency symbol (Euro) into tabout

    The following is an example of my code to produce a table.

    tabout before_var using "C:\Users\sum.txt", ///
    c(mean dk1_var mean dk2_var mean dk1_dk2_var mean dk2_dk1_var mean dk1_dk2_newvar mean dk2_dk1_newvar) ///
    f(2cm 2cm 2c 2c 2cm 2cm) money(\euros) clab(DK1 DK2 DK1 DK2 DK1_CR DK2_CR) sum npos(tufte) ///
    rep

    The default is to insert a dollar sign. I must override that and insert a euro symbol.

    My output looks like this:

    Before (50%) \euros47.08 \euros53.48 289.79 24.08 \euros1,784.89 \euros-9.06

    I have tried the dirty method of copying and pasting the symbol from Word (my keyboard does not have the Euro symbol) so that the code looks like

    f(2cm 2cm 2c 2c 2cm 2cm) money(€) clab(DK1 DK2 DK1 DK2 DK1_CR DK2_CR) sum npos(tufte) ///

    This approach does not work, because the output inserts a period rather than the symbol.
    Before .47.08 .53.48 289.79 24.08 .1,784.89 .-9.06

    Can someone please provide the correct code that will insert the euro symbol, in addition to providing a list a code for other currency symbols.

    Thanks in advance!!!

    Last edited by Elizabeth Unger; 14 Nov 2014, 08:51.

  • #2
    see http://www.stata-journal.com/sjpdf.h...iclenum=dm0006

    The char you want is char(128).

    ps:
    Code:
    clear
    
    set obs 255
    
    gen str2 mycharacter=""
    
    forvalues i=1/255 {
    
    replace  mycharacter=char(`i') if _n==`i'
    
    }
    
    
    list
    Last edited by ben earnhart; 14 Nov 2014, 10:07.

    Comment

    Working...
    X