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

RE: st: How to label the value 999999999999

From   "Nick Cox" <>
To   <>
Subject   RE: st: How to label the value 999999999999
Date   Wed, 8 Oct 2008 17:09:03 +0100

Now illuminated by Nick Winter. 


Caleb Southworth

Nick, thanks for this. The main issue is still unclear: is there a 
limit on the size of number that can be labeled? 

My suggestion of mvencode and the other similar recodes are the way to 

On Wed, 8 Oct 2008, Nick Cox wrote:

:No; this is backward. It's the argument that is problematic, not the
:The possible length of the value label, i.e. a string, is not biting
:here. It is the fact that you are dealing with a large integer, on
:more is said elsewhere. 
:The refusal of -tostring- to produce a string variable in your example
:is easy to explain. -tostring- is a wrapper for -string(<real
:"<format>")- with several safety checks and constraints. The format
:defaults to %12.0g. Some experiments show that you need a different
:format for the conversion of 9...9 (12 digits) to be reversible. 
:. di string(999999999999, "%12.0g")
:. di string(999999999999, "%13.0g")
:. di string(999999999999, "%14.0g")
:So, -tostring- will work as desired here so long as a suitable
:-format()- is specified. 

*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index