@eturnity/eturnity_reusable_components 1.1.80 → 1.1.81
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
|
@@ -9,9 +9,11 @@ export const stringToNumber = ({ value, numberPrecision, allowNegative }) => {
|
|
|
9
9
|
selectedLang === "no-no" ||
|
|
10
10
|
selectedLang === "da-dk" ||
|
|
11
11
|
selectedLang === "de-lu" ||
|
|
12
|
+
selectedLang === "fr-lu" ||
|
|
13
|
+
selectedLang === "es-es" ||
|
|
12
14
|
selectedLang === "de"
|
|
13
15
|
) {
|
|
14
|
-
// replace commas with a dot,
|
|
16
|
+
// replace dots with blank, and commas with a dot: 1.234,56 --> 1234.56
|
|
15
17
|
if (allowNegative) {
|
|
16
18
|
newVal = newVal
|
|
17
19
|
.replace(/[^\d-.,']/g, "")
|
|
@@ -24,7 +26,7 @@ export const stringToNumber = ({ value, numberPrecision, allowNegative }) => {
|
|
|
24
26
|
.replace(/[,\s]/, ".")
|
|
25
27
|
}
|
|
26
28
|
} else if (selectedLang === "en-us") {
|
|
27
|
-
// replace commas with blank
|
|
29
|
+
// replace commas with blank: 1,234.56 --> 1234.56
|
|
28
30
|
if (allowNegative) {
|
|
29
31
|
newVal = newVal.replace(/[^\d-.,']/g, "").replace(/[,\s]/g, "")
|
|
30
32
|
} else {
|
|
@@ -35,7 +37,7 @@ export const stringToNumber = ({ value, numberPrecision, allowNegative }) => {
|
|
|
35
37
|
selectedLang === "fr-ch" ||
|
|
36
38
|
selectedLang === "it-ch"
|
|
37
39
|
) {
|
|
38
|
-
// replace ' with blank
|
|
40
|
+
// replace ' with blank: 1'234.56 --> 1234.56
|
|
39
41
|
if (allowNegative) {
|
|
40
42
|
newVal = newVal.replace(/[^\d-.,']/g, "").replace(/['\s]/g, "")
|
|
41
43
|
} else {
|
|
@@ -43,18 +45,19 @@ export const stringToNumber = ({ value, numberPrecision, allowNegative }) => {
|
|
|
43
45
|
}
|
|
44
46
|
} else if (
|
|
45
47
|
selectedLang === "fr-fr" ||
|
|
46
|
-
selectedLang === "fr-
|
|
48
|
+
selectedLang === "fr-be" ||
|
|
47
49
|
selectedLang === "sv-se" ||
|
|
50
|
+
selectedLang === "pt-pt" ||
|
|
48
51
|
selectedLang === "fr"
|
|
49
52
|
) {
|
|
50
|
-
// replace space with blank, and commas with dot
|
|
53
|
+
// replace space with blank, and commas with dot: 1 234,56 --> 1234.56
|
|
51
54
|
if (allowNegative) {
|
|
52
55
|
newVal = newVal.replace(/[^\d-.,']/g, "").replace(/[,\s]/g, ".")
|
|
53
56
|
} else {
|
|
54
57
|
newVal = newVal.replace(/[^\d.,']/g, "").replace(/[,\s]/g, ".")
|
|
55
58
|
}
|
|
56
59
|
} else {
|
|
57
|
-
// en-US as default
|
|
60
|
+
// en-US as default: 1,234.56 --> 1234.56
|
|
58
61
|
if (allowNegative) {
|
|
59
62
|
newVal = newVal.replace(/[^\d-.,']/g, "").replace(/[,\s]/g, "")
|
|
60
63
|
} else {
|
|
@@ -12,8 +12,12 @@ export const translateLang = (lang) => {
|
|
|
12
12
|
return 'german_ch'
|
|
13
13
|
} else if (lang === 'de-lu') {
|
|
14
14
|
return 'german_lu'
|
|
15
|
-
} else if (lang === 'fr' || lang === 'fr-fr'
|
|
15
|
+
} else if (lang === 'fr' || lang === 'fr-fr') {
|
|
16
16
|
return 'french'
|
|
17
|
+
} else if (lang === 'fr-be') {
|
|
18
|
+
return 'french_be'
|
|
19
|
+
} else if (lang === 'fr-lu') {
|
|
20
|
+
return 'french_lu'
|
|
17
21
|
} else if (lang === 'fr-ch') {
|
|
18
22
|
return 'french_ch'
|
|
19
23
|
} else if (lang === 'it' || lang === 'it-it') {
|