|
Posted by peter on 11/01/06 10:14
> I'm back with another question that I can't find any answers for, so I'm
> hoping you guys can point me in the right direction again.
>
> In the price colum of the product tables I have set to decimal 6,2, I then
> use
>
> $n = ($row['price']) ;
> number_format ($n, 2);
>
> for displaying the correct money format on the page.
>
> As some of the products have the need for "Please call for price", to be
> added to the description, thus leaving the price field empty, I have set
> it to null.
>
> But because I'm using number_format I still get 0.00 displayed on the
> page. Could some one be so kind to explain how I might get around this, or
> know of a link to a site that explains this. Would an if statement be the
> solution? At the moment I've had to use css diplay: none; to get around
> it. But I'd prefer not to have it there full stop.
why not just use an if statement. If null do no formatting and if not null
format it as needed.
Navigation:
[Reply to this message]
|