From | Ernest Berkhout <[email protected]> |
To | [email protected], <[email protected]> |
Subject | Re: st: RE: The last four digits |
Date | Tue, 09 Dec 2003 10:58:42 +0100 |
At 01:41 9-12-2003, Daniel R Sabath wrote:
That is not a completely foolproof solution, as I don't think that the default behaviour for float-variables will be to display leading zero's. The second line is sufficient to extract the 4 last digits, as was the problem at hand.I just wrote some code for this for someone else, so it's fresh on the brain. /* assumes nacimi is numeric and of fixed length */ gen nacimi-1 = real(substr(string(nacimi),1,4)) gen nacimi-2 = real(substr(string(nacimi),-4,4))
© Copyright 1996–2024 StataCorp LLC | Terms of use | Privacy | Contact us | What's new | Site index |