# Store a ratio value in command and then use it to recalculate a length?

I want to store a ratio value in a command, e.g. \newcommand{\ratio}{0.7}, and then use it in recalculating a length, e.g. \setlength{\somelength}{\ratio*\width}.

Using lengths to store the ratio doesn't seem to work as it requires a unit (but ratios are unitless). I've also tried using calc but I can't seem to get it to work.

EDIT: Minimal example:

\documentclass{standalone}

\newcommand{\widthRatio}{0.7}
\newlength{\newWidth}
\setlength{\newWidth}{\widthRatio*\textwidth} % Doesn't compile

\begin{document}
\end{document}

-
If \width is a register like \textwidth then your code would work if you omit * –  David Carlisle Mar 13 '13 at 14:39
With code samples of your unsuccesful attempts, it would be better, and you would likely get a full answer instead of a one liner from @David. –  yo' Mar 13 '13 at 14:49
@tohecz: There, minimal example added. =) –  gablin Mar 14 '13 at 7:47
@DavidCarlisle: Cool, didn't know about that! Could you please add that as an answer so that I can accept it? –  gablin Mar 14 '13 at 7:47

As \textwidth is a dimen register if you omit the * it is already correct syntax.