@mythpe/quasar-ui-qui 0.4.7 → 0.4.8
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 +1 -1
- package/src/utils/Helpers.ts +6 -4
package/package.json
CHANGED
package/src/utils/Helpers.ts
CHANGED
|
@@ -297,15 +297,17 @@ export const Helpers = {
|
|
|
297
297
|
}
|
|
298
298
|
return `//${path}`
|
|
299
299
|
},
|
|
300
|
-
formatMoney (value: any = '', suffix: string = ''): string {
|
|
300
|
+
formatMoney (value: any = '', suffix: string = '', options?: Intl.NumberFormatOptions): string {
|
|
301
301
|
let numValue = typeof value !== 'number' ? parseFloat(value) : value
|
|
302
302
|
if (isNaN(numValue)) {
|
|
303
303
|
numValue = 0.00
|
|
304
304
|
}
|
|
305
|
-
const
|
|
305
|
+
const opt = {
|
|
306
306
|
minimumFractionDigits: 2,
|
|
307
|
-
maximumFractionDigits: 2
|
|
308
|
-
|
|
307
|
+
maximumFractionDigits: 2,
|
|
308
|
+
...(options || {})
|
|
309
|
+
}
|
|
310
|
+
const formattedValue = numValue.toLocaleString('en-US', opt)
|
|
309
311
|
return `${formattedValue} ${suffix}`.trim()
|
|
310
312
|
},
|
|
311
313
|
calculateAspectRatio: (width: number | string, height: number | string): [number, string] => {
|