@signal24/vue-foundation 4.13.2 → 4.13.3
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,5 +2,5 @@ export { escapeHtml } from '@vue/shared';
|
|
|
2
2
|
export declare function nl2br(value: string): string;
|
|
3
3
|
export declare function desnakeCase(value: string): string;
|
|
4
4
|
export declare function formatPhone(value: string): string;
|
|
5
|
-
export declare function formatUSCurrency(value: string | number): string;
|
|
5
|
+
export declare function formatUSCurrency(value: string | number, divisor?: number): string;
|
|
6
6
|
export declare function uuid(): string;
|
|
@@ -460,8 +460,8 @@ function xt(e) {
|
|
|
460
460
|
const t = e.replace(/\D/g, "").replace(/^1/, "");
|
|
461
461
|
return t.length != 10 ? e : "(" + t.substring(0, 3) + ") " + t.substring(3, 6) + "-" + t.substring(6);
|
|
462
462
|
}
|
|
463
|
-
function Lt(e) {
|
|
464
|
-
return "$" + Number(e).toFixed(3).replace(/0$/, "").replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
463
|
+
function Lt(e, t = 1) {
|
|
464
|
+
return "$" + (Number(e) / t).toFixed(3).replace(/0$/, "").replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
465
465
|
}
|
|
466
466
|
function Kn() {
|
|
467
467
|
return St();
|
package/package.json
CHANGED
package/src/helpers/string.ts
CHANGED
|
@@ -18,10 +18,10 @@ export function formatPhone(value: string) {
|
|
|
18
18
|
return '(' + cleanValue.substring(0, 3) + ') ' + cleanValue.substring(3, 6) + '-' + cleanValue.substring(6);
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
export function formatUSCurrency(value: string | number) {
|
|
21
|
+
export function formatUSCurrency(value: string | number, divisor = 1) {
|
|
22
22
|
return (
|
|
23
23
|
'$' +
|
|
24
|
-
Number(value)
|
|
24
|
+
(Number(value) / divisor)
|
|
25
25
|
.toFixed(3)
|
|
26
26
|
.replace(/0$/, '')
|
|
27
27
|
.replace(/\B(?=(\d{3})+(?!\d))/g, ',')
|