@megha-ui/react 1.2.75 → 1.2.77
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.
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.formatValue = void 0;
|
|
4
4
|
// Function to format numbers
|
|
5
|
-
const formatNumber = (value, locale = "
|
|
5
|
+
const formatNumber = (value, locale = "sv-SE", options = {}) => {
|
|
6
6
|
const formatter = new Intl.NumberFormat(locale, options);
|
|
7
7
|
return formatter.format(value);
|
|
8
8
|
};
|
|
9
9
|
// Function to format dates
|
|
10
|
-
const formatDate = (date, locale = "
|
|
10
|
+
const formatDate = (date, locale = "sv-SE", options = {}) => {
|
|
11
11
|
const formatter = new Intl.DateTimeFormat(locale, options);
|
|
12
12
|
return formatter.format(date);
|
|
13
13
|
};
|
|
14
14
|
// Function to format currency
|
|
15
|
-
const formatCurrency = (value, locale = "
|
|
15
|
+
const formatCurrency = (value, locale = "sv-SE", currency = "SEK", options = {}) => {
|
|
16
16
|
const formatter = new Intl.NumberFormat(locale, Object.assign({ style: "currency", currency: currency }, options));
|
|
17
17
|
return formatter.format(value);
|
|
18
18
|
};
|
package/package.json
CHANGED