Reply to Re: not displaying null data when using number_format

Your name:

Reply:


Posted by linda on 11/01/06 15:46

"peter" <submit@flexiwebhost.com> wrote in message
news:ei9s2i$kdf$1@web.aioe.org...
>> 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.
>

Hi Peter,

Thank you for replying first of all, I've just posted a reply to Martin,
with what I have been trying using the if statement. But I'm unable to get
it to work. Would you mind enlightening me on what I have been doing wrong?
I haven't been working with php for very long, so any guidance would be very
gratefully received.

Best wishes,
Linda

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация