Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: AW: Re: st: RE: Re: st: Re: st: From: Χρυσούλα Γιαννικοπούλου <chrygiann@gmail.com>


From   "Martin Weiss" <martin.weiss1@gmx.de>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: AW: Re: st: RE: Re: st: Re: st: From: Χρυσούλα Γιαννικοπούλου <chrygiann@gmail.com>
Date   Tue, 10 Aug 2010 14:13:50 +0200

<> 

-input- is just for us to recreate your dataset, and everybody else to quickly launch themselves into the discussion, should they so wish... 

You just run 

***
replace num = reverse(subinstr ///
(reverse(num), ".", ",", 1))
destring num, replace ignore(.) dpcomma
format num %9,0gc
***

and you are done...

HTH
Martin

-----Ursprüngliche Nachricht-----
Von: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von ???s???a G?a?????p?????
Gesendet: Dienstag, 10. August 2010 13:58
An: statalist@hsphsun2.harvard.edu
Betreff: st: Re: st: RE: Re: st: Re: st: From: Χρυσούλα Γιαννικοπούλου <chrygiann@gmail.com>

Thank you Martin!!!

Sorry, I didn't understand again!
I have 72914 observations so, do you mean after "input str20 num" to
write the variable name?

I can not write 72914 observations!!

I would like more details pleaseeee!!!!

Many thanks :)

*** I didn't thought the -li- as the stata command -list- that time :(

Yours,
Chrysa

2010/8/10 Martin Weiss <martin.weiss1@gmx.de>:
>
> <>
>
> Well, the solution is already there for your consumption:
>
> ***********
> clear*
> input str20 num
> 44.311.90
> 7.660.60
> 2.964.52
> 1.229.357.80
> 1.376.146.80
> 279.161.53
> 856.551.10
> end
>
> replace num = reverse(subinstr ///
>        (reverse(num), ".", ",", 1))
> destring num, replace ignore(.) dpcomma
> format num %9,0gc
>
> li
> ***********
>
> BTW, his name is "T", -li- is a Stata command...
>
> HTH
> Martin
>
>
> -----Original Message-----
> From: owner-statalist@hsphsun2.harvard.edu
> [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of ???s???a
> G?a?????p?????
> Sent: Dienstag, 10. August 2010 13:06
> To: statalist@hsphsun2.harvard.edu
> Subject: st: Re: st: Re: st: From: Χρυσούλα Γιαννικοπούλου
> <chrygiann@gmail.com>
>
> Hi Li,
>
> many thanks for the immediate reply!
>
> Unfortunately, this doesn't help. Ok, it's completely my fault that I
> did't explain my problem more detailed.
>
> So, I have a variable name "dealvalue" in string format  with 72914
> observations!!!
>
> These observations are numbers but each observation has a different
> number of digits.
> For example:
>
> 2.964.52
> 1.229.357.80
> 1.376.146.80
> 279.161.53
> 856.551.10
>
> 3.669.70
> 3.153.20
> 30.882.40
> 12.858.29
> 41.284.40
>
> 14.504.50
> 1.531.50
>
> 17.823.72
> -1
> 9.009.00
>
>
> I would like the "," to specify the decimals and the "." to be used
> for the 1000 separator.
>
> Hence, these numbers i would like to appear like :
>
> 2.964,52
> 1.229.357,80
> 1.376.146,80
> 279.161,53
> 856.551,10
>
> 3.669,70
> 3.153,20
> 30.882,40
> 12.858,29
> 41.284,40
>
> 14.504,50
> 1.531,50
>
> 17.823,72
> -1,00
> 9.009,00
>
> This is just a sample!!! I need a command to do it automatically for
> all the observations.
>
> Thanks again!!
>
> I appreciate your help!
>
>
>
> 2010/8/10 Tirthankar Chakravarty <tirthankar.chakravarty@gmail.com>:
>> Try this:
>> **********************
>> clear*
>> input str20 num
>> 44.311.90
>> 7.660.60
>> 2.964.52
>> 1.229.357.80
>> 1.376.146.80
>> 279.161.53
>> 856.551.10
>> end
>> compress
>> replace num = reverse(subinstr ///
>>        (reverse(num), ".", ",", 1))
>> li
>> **********************
>>
>> T
>>
>> 2010/8/10  <owner-statalist@hsphsun2.harvard.edu>:
>>> Hi all,
>>>
>>> how can format these numbers
>>> 44.311.90
>>> 7.660.60
>>> 2.964.52
>>> 1.229.357.80
>>> 1.376.146.80
>>> 279.161.53
>>> 856.551.10
>>> so that the last "." to be "," ?
>>>
>>>
>>> thanks a lot!!
>>>
>>> chrysa
>>> *
>>> *   For searches and help try:
>>> *   http://www.stata.com/help.cgi?search
>>> *   http://www.stata.com/support/statalist/faq
>>> *   http://www.ats.ucla.edu/stat/stata/
>>>
>>
>>
>>
>> --
>> To every ω-consistent recursive class κ of formulae there correspond
>> recursive class signs r, such that neither v Gen r nor Neg(v Gen r)
>> belongs to Flg(κ) (where v is the free variable of r).
>>
>> *
>> *   For searches and help try:
>> *   http://www.stata.com/help.cgi?search
>> *   http://www.stata.com/support/statalist/faq
>> *   http://www.ats.ucla.edu/stat/stata/
>>
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index