Skip to content

Commit

Permalink
Set default value of currency
Browse files Browse the repository at this point in the history
  • Loading branch information
dxvladislavvolkov committed Jun 27, 2018
1 parent 3a159c4 commit 36d0af6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/number.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ numberLocalization.inject({
return result;
},
getOpenXmlCurrencyFormat: function(currency) {
var options = this._getCurrencyOptions(currency);
var currencyValue = currency || dxConfig().defaultCurrency,
options = this._getCurrencyOptions(currencyValue);
return this._createOpenXmlCurrencyFormat(options);
}
});
4 changes: 4 additions & 0 deletions tests/number-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,4 +209,8 @@ locales.forEach(function(localeId) {
}
}
});

QUnit.test('getOpenXmlCurrencyFormat should return default format when currency is undefined', function(assert) {
assert.equal(numberLocalization.getOpenXmlCurrencyFormat(undefined), '$#,##0{0}');
});
});

0 comments on commit 36d0af6

Please sign in to comment.