Advertisement

04.01.2008 at 05:45PM PDT, ID: 23287794
[x]
Attachment Details

Number Format of Query Results

Asked by arthur_raft2 in PHP and Databases, PHP Scripting Language, MySQL

Hello Experts,

Attached is a snipet that sucessfully queries my DB and formats the results.

What I require - modification so that if the reslt is zero, zero is shown. For example, on the first cell, if the result is going to be 0, rather than display 0 kW Hrs, a simple hypen is shown.

Sure this is easy for you guys. Cheers, ArthurStart Free Trial
1:
echo "<td>"  .number_format($sum * $multiplier * 30.42 , 0, '.', ',')."&nbsp;kW Hrs</td><td>$&nbsp;" .number_format($sum * $multiplier * 30.42 * 0.07, 2, '.', ',')."</td><td>$&nbsp;" .number_format($sum * $multiplier * 30.42 * 0.14, 2, '.', ',')."</td></tr>
[+][-]04.01.2008 at 06:31PM PDT, ID: 21259487

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: PHP and Databases, PHP Scripting Language, MySQL
Sign Up Now!
Solution Provided By: drxav
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628