From 48835d47fa55989cfd3248e61b04751db003c75c Mon Sep 17 00:00:00 2001 From: Harminder Virk Date: Mon, 18 Oct 2021 14:53:15 +0530 Subject: [PATCH] feat: support bigInt data type in formatCurrency method --- adonis-typings/i18n.ts | 2 +- src/Formatters/Core/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/adonis-typings/i18n.ts b/adonis-typings/i18n.ts index c7c0c36..a054983 100644 --- a/adonis-typings/i18n.ts +++ b/adonis-typings/i18n.ts @@ -111,7 +111,7 @@ declare module '@ioc:Adonis/Addons/I18n' { /** * Formats a numeric value to a currency display value */ - formatCurrency(value: string | number, options: CurrencyFormatOptions): string + formatCurrency(value: string | number | bigint, options: CurrencyFormatOptions): string /** * Formats date, luxon date, ISO date/time string or a timestamp to diff --git a/src/Formatters/Core/index.ts b/src/Formatters/Core/index.ts index 7f759e6..d0a25ab 100644 --- a/src/Formatters/Core/index.ts +++ b/src/Formatters/Core/index.ts @@ -79,7 +79,7 @@ export class Formatter implements FormatterContract { /** * Formats a numeric value to a currency display value */ - public formatCurrency(value: string | number, options: CurrencyFormatOptions): string { + public formatCurrency(value: string | number | bigint, options: CurrencyFormatOptions): string { const currencyOptions = { style: 'currency' as const, ...options } return this.formatNumber(value, currencyOptions) }