Link to home
Start Free TrialLog in
Avatar of budgin
budgin

asked on

I want numeric, Not string.

How can I convince use CGI qw(:standard) that $price = param("cost") is intended as a number and not a string?
Avatar of ozo
ozo
Flag of United States of America image

Does it now believe it it not intended as a number?
Avatar of budgin
budgin

ASKER

It keeps returning a value of zero.
in the start_html() part of the program, I have (print $price;) and it returns "25", but it wont add it to the cookie.
If I use ($price = 25;) it adds it, but I need it to read a value from another form.
If (print $price;) is really returning with the quotes around the number, then those non-numeric characters would make it have a value of zero when adding.
You could remove all non-digits from $price with something like
$price =~ s/\D//g;
Avatar of budgin

ASKER

I thank you very much for your help. I would appreciate it if you would take a look at http://www.budmar.com/budcart.htm  I have links to code in the CGIs.
What are you adding $price to?
ASKER CERTIFIED SOLUTION
Avatar of alamo
alamo

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of budgin

ASKER

Thanks Much to ozo and alamo. I see what I was doing. Without a need for a quanity feature when selling antiques, I was trying to alter that parameter, instead of using gumption. I am starting form scratch, and being patient.