Home: Perl Programming Help: Intermediate:
dividing a variable?



Dreamer
Deleted

Mar 4, 2000, 1:28 PM


Views: 2615
dividing a variable?

Hi. I need some help with the "math" portion in this code on my program.
What I have is a variable $price and a variable $Zprice. $Zprice needs to be 1/2 (50%)of $price. Any help on how to do that would be appreciated, cuz my mind has just gone blank!
TIA,
Dreamer


Cure
User

Mar 4, 2000, 2:07 PM


Views: 2615
Re: dividing a variable?

Hi Dreamer

$price = 10;
$Zprice = $price * .5;


Cure


Dreamer
Deleted

Mar 4, 2000, 2:14 PM


Views: 2615
Re: dividing a variable?

LOL

Thanks Cure ... I was trying to use an "x" instead of "*" to multiply! While we're on that subject, is there a way to divide the variables, or is it only multiplying?

Again, thanks!!!
Dreamer


Cure
User

Mar 4, 2000, 3:32 PM


Views: 2615
Re: dividing a variable?

Hi Dreamer

$price = 10;
$Zprice = $price/2;

Cure


Dreamer
Deleted

Mar 4, 2000, 3:59 PM


Views: 2615
Re: dividing a variable?

hehehe

Did you ever have one of those days when you know you know the answer but you can't think of it? Thanks so much for your help, I really appreciate it.
Dreamer


Cure
User

Mar 4, 2000, 4:04 PM


Views: 2615
Re: dividing a variable?

Hi

Your Welcome..

I know what you mean -> I have days like that also.

Cure