Updated FormatConverter to Format Price based on Currency (if provided)

- Fixes #176 Issue
- Renamed formatToTwoDecimalPlaces to formatToNumber
This commit is contained in:
japatel
2014-12-08 17:11:33 -06:00
parent 8bb80cb843
commit 7c4a16ca3d
8 changed files with 106 additions and 15 deletions

View File

@@ -113,7 +113,7 @@ class Item extends PPModel
{
NumericValidator::validate($price, "Price");
$price = FormatConverter::formatToTwoDecimalPlaces($price);
$price = FormatConverter::formatToPrice($price, $this->getCurrency());
$this->price = $price;
return $this;
}
@@ -139,7 +139,7 @@ class Item extends PPModel
public function setTax($tax)
{
NumericValidator::validate($tax, "Tax");
$tax = FormatConverter::formatToTwoDecimalPlaces($tax);
$tax = FormatConverter::formatToPrice($tax, $this->getCurrency());
$this->tax = $tax;
return $this;
}