fix amount error when amount is incomplete

This commit is contained in:
MaysWind
2020-12-29 00:38:40 +08:00
parent da5fde45cd
commit 5886954053
+10
View File
@@ -11,8 +11,18 @@ export default function ({i18n}, value, currencyCode) {
value = value.toString();
}
const hasIncompleteFlag = utils.isString(value) && value.charAt(value.length - 1) === '+';
if (hasIncompleteFlag) {
value = value.substr(0, value.length - 1);
}
value = utils.numericCurrencyToString(value);
if (hasIncompleteFlag) {
value = value + '+';
}
const currencyDisplayMode = settings.getCurrencyDisplayMode();
if (currencyCode && currencyDisplayMode === 'symbol') {