Adam,
Not sure exactly what you are trying to do, but from what i gather...
you don't want to say:
@fieldprice > 0
as that will put the "array" fieldprice in scalar contect, and give you
back the number of elements in that array...
Now Assuming:
$fieldprice = 14.95
You should be able to say:
if ($fieldprice != 0) { # aka, if $fieldprice does not
# equal 0 (in numerical context)
&showHTML();
}
else {
# do something else...
}
On Mon, 2003-01-06 at 12:17, Adam Southerland wrote:
> Hi all...
>
> I have worked for about 6 hours on one bit of code and to be honest, I
> am bum-fuzzeled. I don't know who to ask or where to look for help..
> Chat rooms seem to be of no use..
>
> I have values - 14.95 and 28.00 and 0.00
>
> I want this code to say, if equal 0.00 then don't display html, else
> display it.
>
> My Var = @fieldprice
>
> If (@fieldprice > 0) { #show HTML; }
> Or
> If (@fieldprice gt "0") { #show HTML; }
>
> Here is the true problem:
> In the comparison the Variable is jacked up and returns only '.##' (Ex.
> '.95' '.00' '.00')
>
> So any even number priced doesn't get shown.
>
> Someone said do a 'RegExp' (Regular Expresion) like this /\d+\.\d+/
> \d+ = numeric number
> \. = '.'
> / is beginning and end.
>
> I have tried
> @fieldprice = /\d+\.\d+/;
> but it still fails to work right.
>
> If you don't know, perhaps you know someone who does?
>
> Any help is grateful =)
>
> Adam Southerland
>
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]