Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Accepts 0.99, but not .99..why?

Status
Not open for further replies.

wudz

Programmer
Mar 28, 2001
135
0
0
GB
Hi,

I have just come across a problem.
If a person places .99 in the bid my script gives the $ERR_058.
I thought it would have been a valid input.
Works ok if they input 0.99, I would obviously prefer it to accept both types...Where have I gone wrong?

if (!checkmoney($bid)) {
include("header.php");
$TPL_errmsg = $ERR_058;
$bidH = $bid;
include("templates/template_bid_php.html");

include("footer.php");
exit;
}

Keep thinking I am getting there on the learning curve...

Cheers in anticipation

John
 
It seems that checkmoney() is the function which validates the user input. Can you post the function code?

--------------------------------------------------------------------------
I never set a goal because u never know whats going to happen tommorow.
 
cast the value to a float.

Code:
$bid ".99";
$bid = (float) $bid;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top