diff --git a/include/fields/CurrencyField.php b/include/fields/CurrencyField.php index 44e9a735f..07ca672ab 100644 --- a/include/fields/CurrencyField.php +++ b/include/fields/CurrencyField.php @@ -363,7 +363,7 @@ public function getDBInsertedValue($user=null, $skipConversion=false) { } //$value = round($value, $this->maxNumberOfDecimals); - return $value; + return (float)$value; } /** @@ -415,7 +415,7 @@ public static function convertToDollar($amount, $conversionRate) { public static function convertFromDollar($amount, $conversionRate) { $currencyField = new CurrencyField($amount); - return round($amount * $conversionRate, $currencyField->maxNumberOfDecimals); + return round( (float)$amount * (float)$conversionRate, $currencyField->maxNumberOfDecimals); } /** This function returns the amount converted from master currency. @@ -423,7 +423,7 @@ public static function convertFromDollar($amount, $conversionRate) { * param $crate - conversion rate. */ public static function convertFromMasterCurrency($amount, $conversionRate) { - return $amount * $conversionRate; + return (float)$amount * (float)$conversionRate; } function currencyDecimalFormat($value, $user = null){ @@ -464,4 +464,3 @@ function currencyDecimalFormat($value, $user = null){ } } } -?> \ No newline at end of file