Copy link to clipboard
Copied
Hi Chaps,
I have an SQL query that calculates a word count multiplied by a fixed figure:
"...$pricegross = ($row_rsInvPending['projanalysis_total']*$row_rsInvPending['costbase']);..."
Then use a bit of php code to round up the figure to 2 decimal places....
<?php echo number_format($pricegross, 2, '.', ''); ?>
I then total up $pricegross for all records:
".....SELECT SUM(projanalysis_total) as total_pricegross..."
If I have two records:
($pricegross) 1. £2.295
($pricegross) 2. £2.295
There are both displayed as £2.30, which is what I want
Then the total ($total_pricegross) shows up as £4.59, but what I want is: £4.60
Is this possible?
Hope this is clear?!
I don't know php, but wouldn't you just use the same rounding function (assuming that's what number_format is doing)?
<?php echo number_format($total_pricegross, 2, '.', ''); ?>
Copy link to clipboard
Copied
I don't know php, but wouldn't you just use the same rounding function (assuming that's what number_format is doing)?
<?php echo number_format($total_pricegross, 2, '.', ''); ?>
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more