Announcement

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

  • European Number Format to American Format(13.302,42 to 13,302.42)

    Hi Stata users,

    thanks to the help from this forum, I konw now about the destring replace dpcomma, which replaces comma with punctuation.

    But it does not solve my issue. I have also values such as 13.302,42 which is indeed 13,302.42 in the U.S.
    I want to destring 13.302,42 as 13302.42

    Could you please share any idea about this?

    Thank you very much!

  • #2
    Code:
    . gen foo = "13.302,42"
    
    . destring foo, dpcomma ignore(".") gen(foo2)
    foo: character . removed; foo2 generated as double
    
    . l foo* in 1
    
         +----------------------+
         |       foo       foo2 |
         |----------------------|
      1. | 13.302,42   13302.42 |
         +----------------------+

    Comment


    • #3
      Hi Nick,

      thank you so much for the follow-up.
      This works!

      Comment

      Working...
      X