I have probably formulated the question wrong, as I don't know the Tex internals - but this is what I mean; consider this example:
\newcommand{\myNum}{2}
\newlength{\myLength}
\setlength{\myLength}{\myNum cm}
Here, I'd consider \myNum to represent a 'numeric variable', and \myLength a Tex length (i.e. a number and a unit); and so I'd consider the above example a "conversion" from numeric to length "variable".
Is it possible to do the other way around? I.e. if \myLength is given to be 2 cm, is there a command that will "get"/"extract" the numeric value only? I'd imagine doing something like this (pseudocode):
\newcommand{\myNum}{\getlength{\myLength}}
... after which, \myNum would have value "2" ...
Does anything like this exist?
EDIT: I guess I need something similar to \the which is for counters ... ?!


\the\myLengthgives you the dimension, I don't know how you'd extract just the number... If you wanted to do something like this, I expect thecalcpackage might be useful. Or possibly this package – Seamus Apr 05 '11 at 10:53\thecould be applied to lengths too (try searching for "latex \the", hehe :) );\theMyLengthindeed prints the length, but seemingly inptunits. – sdaau Apr 05 '11 at 10:56