cja-phoenix 1.0.6 → 1.0.7

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/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cja-phoenix",
3
3
  "configKey": "cja-phoenix",
4
- "version": "1.0.6",
4
+ "version": "1.0.7",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -1,4 +1,4 @@
1
1
  export declare const formatCurrency: (n: number | undefined, maxDigits?: number) => string;
2
- export declare const formatPercent: (n: number, maxDigits?: number) => string;
2
+ export declare const formatPercent: (n: number, maxDigits?: number, minDigits?: number) => string;
3
3
  export declare const formatDateString: (d: string, format?: "DD/MM/YYYY" | "MM/YYYY") => string;
4
4
  export declare const formatPositiveNumber: (n: number) => number;
@@ -2,13 +2,15 @@ export const formatCurrency = (n, maxDigits = 2) => {
2
2
  const { format } = new Intl.NumberFormat("de-DE", {
3
3
  style: "currency",
4
4
  currency: "EUR",
5
- maximumFractionDigits: maxDigits
5
+ maximumFractionDigits: maxDigits,
6
+ trailingZeroDisplay: "stripIfInteger"
6
7
  });
7
- return format(n || 0).replace(",00", "");
8
+ return format(n || 0);
8
9
  };
9
- export const formatPercent = (n, maxDigits = 2) => `${n.toLocaleString("de-DE", {
10
+ export const formatPercent = (n, maxDigits = 2, minDigits = 2) => `${n.toLocaleString("de-DE", {
10
11
  maximumFractionDigits: maxDigits,
11
- minimumFractionDigits: 2
12
+ minimumFractionDigits: minDigits,
13
+ trailingZeroDisplay: "stripIfInteger"
12
14
  })}%`;
13
15
  export const formatDateString = (d, format) => {
14
16
  const date = new Date(d).toLocaleDateString("pt");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cja-phoenix",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "Phoenix utility",
5
5
  "repository": "comparaja/phoenix",
6
6
  "license": "MIT",