Jump to content

number format problem


mindapolis

Recommended Posts

hi, I have a function that calculates sales tax and it should put 2 numbers  after the decimal point but it 's putting 5 numbers after the decimal point.  Can someone help me figure out why? 

 

function TotalSalesTax($price)
{
	$salesTax = .07;
	$TotalSalesTax = $price * $salesTax;
    number_format($TotalSalesTax, 2);	
	return $TotalSalesTax;		
}

Link to comment
https://forums.phpfreaks.com/topic/252085-number-format-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.