@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/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "email": "bruno@tagplus.com.br"
9
9
  }
10
10
  ],
11
- "version": "1.2.13",
11
+ "version": "1.2.14",
12
12
  "main": "./dist/tp.common.js",
13
13
  "directories": {
14
14
  "lib": "src/lib"
@@ -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
- return negative === -1 ? '-' + currency : '' + currency
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
  }