@megha-ui/react 1.2.74 → 1.2.76

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,20 +2,15 @@
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 = "en-US", options = {}) => {
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 = "en-US", options = {}) => {
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
- // Function to format currency
15
- const formatCurrency = (value, locale = "en-US", currency = "USD", options = {}) => {
16
- const formatter = new Intl.NumberFormat(locale, Object.assign({ style: "currency", currency: currency }, options));
17
- return formatter.format(value);
18
- };
19
14
  // Dynamic formatter function
20
15
  const formatValue = (value, type = "number", locale = "sv-SE", options = {
21
16
  currency: "SEK",
@@ -28,10 +23,6 @@ const formatValue = (value, type = "number", locale = "sv-SE", options = {
28
23
  const date = new Date(value);
29
24
  return formatDate(date, locale, options);
30
25
  }
31
- else if (type === "currency") {
32
- const num = parseFloat(value.toString());
33
- return formatCurrency(num, locale, options.currency, options);
34
- }
35
26
  else {
36
27
  return value;
37
28
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@megha-ui/react",
3
- "version": "1.2.74",
3
+ "version": "1.2.76",
4
4
  "description": "A collection of reusable UI components for React applications, built with TypeScript.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",