Nick Cox
>
> Zero fill is unnecessary, even this route.
>
> The last two characters are
>
> substr(string(myvar),-2,2)
>
> The first substring wanted is
>
> substr(string(myvar),1,length(string(myvar))-3)
>
> The whole is thus
>
> substr(string(myvar),-2,2) +
> substr(string(myvar),1,length(string(myvar))-3)
>
> and the numeric equivalent is
>
> real(substr(string(myvar),-2,2) +
> substr(string(myvar),1,length(string(myvar))-3))
>
> Not tested.
Not only not tested, but wrong in that
the order of the substrings should be reversed.
Nick
[email protected]
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/