mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-31 11:14:37 -04:00
Fixes for displaying negative currencies
This commit is contained in:
parent
2f3cee2fc2
commit
681fc47a68
@ -137,6 +137,8 @@ class Number
|
|||||||
{
|
{
|
||||||
$value = floatval($value);
|
$value = floatval($value);
|
||||||
|
|
||||||
|
$_value = $value;
|
||||||
|
|
||||||
$currency = $entity->currency();
|
$currency = $entity->currency();
|
||||||
|
|
||||||
$thousand = $currency->thousand_separator;
|
$thousand = $currency->thousand_separator;
|
||||||
@ -177,6 +179,15 @@ class Number
|
|||||||
} elseif ($swapSymbol) {
|
} elseif ($swapSymbol) {
|
||||||
return "{$value} ".trim($symbol);
|
return "{$value} ".trim($symbol);
|
||||||
} elseif ($entity->getSetting('show_currency_code') === false) {
|
} elseif ($entity->getSetting('show_currency_code') === false) {
|
||||||
|
|
||||||
|
/* Ensures we place the negative symbol ahead of the currency symbol*/
|
||||||
|
if($_value < 0){
|
||||||
|
|
||||||
|
$value = substr($value, 1);
|
||||||
|
$symbol = "-{$symbol}";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return "{$symbol}{$value}";
|
return "{$symbol}{$value}";
|
||||||
} else {
|
} else {
|
||||||
return self::formatValue($value, $currency);
|
return self::formatValue($value, $currency);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user