Jump to content

Recommended Posts

Posted

Please format the tax rate on display. Instead of displaying GST (15.0000%) I want it to display GST (15%). Probably something like floatval($tax_rate) would be fine, I can't think of a reason anybody would need extra 0s. As a workaround I've changed the database column to be an INT.

Posted

I know of at least one province in Canada that has a provincial sales tax rate of 9.975%, so it definitely needs the decimal places. However, I don't need them, so I used round( ) on the tax rate in my invoice template to get rid of those zeros in the pdf invoice.

 

In line 315 of components/invoice_templates/default_invoice/default_invoice_pdf.php change $tax->amount to round($tax->amount) so that it looks like

$data[] = array('notes'=>null,'label'=>Language::_("DefaultInvoice.tax_heading", true, $tax->name, round($tax->amount)),'price'=>$this->CurrencyFormat->format($tax->tax_total, $this->invoice->currency, self::$standard_num_options));

If you still want some of the decimal places, you can specify how many like this round($tax->amount,2)

 

It doesn't bother me if the zeros still appear in the admin panel, so this change was all it took to make me happy.

Posted

I know of at least one province in Canada that has a provincial sales tax rate of 9.975%, so it definitely needs the decimal places.

I wasn't suggesting to remove numbers after the decimal, floatval() just removes the extraneous 0s. e.g.

floatval(1.1234) = 1.1234
floatval(1.1230 ) = 1.123
floatval(1.0000) = 1
$amount + 0 or (float)$amount do the same thing.
  • 1 year later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...