From: Steve Bertrand <[EMAIL PROTECTED]>
> >> $var = sprintf ("%.2f", (($var /=1024) /=1024)))
> >
> > What the ...?!?
> >
> > /= ?
>
> It was an off the top of my head example of what I wanted to do. Without
> being at the code at the time, I was simply thinking +=.
If you want to divide somet
> $var = sprintf ("%.2f", $var / (1024*1024));
>
> And it will be more efficient because the multiplication will be done
> at compile time (once) and you'll only do a single division each
> time. Which is also more precise, though in this case it doesn't seem
> to matter.
Oh, and furthermore,
>> $var = sprintf ("%.2f", (($var /=1024) /=1024)))
>
> What the ...?!?
>
> /= ?
It was an off the top of my head example of what I wanted to do. Without
being at the code at the time, I was simply thinking +=.
> You divide the value of $var by 1024, assign it back to $var, divide
> it by anot
From: Steve Bertrand <[EMAIL PROTECTED]>
> Hi again all,
>
> Is there a way that one can use sprintf on a variable and assign the
> value back to the variable without having the leading $var= ?
>
> $var = sprintf ("%.2f", (($var /=1024) /=1024)))
What the ...?!?
/= ?
You divi
Gunnar Hjalmarsson wrote:
> Steve Bertrand wrote:
>> Is there a way that one can use sprintf on a variable and assign the
>> value back to the variable without having the leading $var= ?
>>
>> $var = sprintf ("%.2f", (($var /=1024) /=1024)))
>
> You can write a function.
>
> convert( $var );
Steve Bertrand wrote:
Is there a way that one can use sprintf on a variable and assign the
value back to the variable without having the leading $var= ?
$var = sprintf ("%.2f", (($var /=1024) /=1024)))
You can write a function.
convert( $var );
sub convert { $_[0] = sprintf '%.2f', $
On Nov 28, 2007, at 11:26 AM, Steve Bertrand wrote:
Is there a way that one can use sprintf on a variable and assign the
value back to the variable without having the leading $var= ?
I don't think you can do it directly, but you can use the aliasing
properties of sub or for:
$a_really_long_
Hi again all,
Is there a way that one can use sprintf on a variable and assign the
value back to the variable without having the leading $var= ?
$var = sprintf ("%.2f", (($var /=1024) /=1024)))
I've got a hash of hashrefs of hashrefs and I'd rather not specify the
variable name on the left and r