@tagplus/components 1.2.13 → 1.2.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/tp.common.js +1 -1
- package/dist/tp.common.js.map +1 -1
- package/dist/tp.umd.js +1 -1
- package/dist/tp.umd.js.map +1 -1
- package/dist/tp.umd.min.js +1 -1
- package/dist/tp.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/utils/currency.js +4 -2
package/package.json
CHANGED
package/src/utils/currency.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { messages } from 'tp-ui/locale'
|
|
1
|
+
import { messages, t } from 'tp-ui/locale'
|
|
2
|
+
|
|
2
3
|
const defaults = messages().locale.number
|
|
3
4
|
|
|
4
5
|
function format (input, opt = defaults) {
|
|
@@ -31,7 +32,8 @@ function formatMoney (input, toString = false, precision = defaults.precision) {
|
|
|
31
32
|
const numbers = onlyNumbers(input, precision)
|
|
32
33
|
const currency = numbersToCurrency(numbers, precision)
|
|
33
34
|
if (toString) {
|
|
34
|
-
|
|
35
|
+
const num = negative === -1 ? '-' + currency : '' + currency
|
|
36
|
+
return num.replaceAll(',', t('locale.number.decimal')).replaceAll('.', t('locale.number.decimal'))
|
|
35
37
|
} else {
|
|
36
38
|
return currency * negative
|
|
37
39
|
}
|