Skip to content

Commit

Permalink
fix formatting for negative currency with prefix sign
Browse files Browse the repository at this point in the history
  • Loading branch information
BenjaminVanRyseghem committed Sep 22, 2017
1 parent b01398f commit 8b4d17e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/formatting.js
Expand Up @@ -297,7 +297,11 @@ function formatCurrency(instance, providedFormat, state) {
});

if (currentCurrency.position === "prefix") {
output = currentCurrency.symbol + space + output;
if (instance._value < 0 && options.negative === "sign") {
output = `-${space}${currentCurrency.symbol}${output.slice(1)}`;
} else {
output = currentCurrency.symbol + space + output;
}
}

if (!currentCurrency.position || currentCurrency.position === "postfix") {
Expand Down

0 comments on commit 8b4d17e

Please sign in to comment.