Skip to content

Commit

Permalink
feat: support bigInt data type in formatCurrency method
Browse files Browse the repository at this point in the history
  • Loading branch information
thetutlage committed Oct 18, 2021
1 parent cdb6dea commit 48835d4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion adonis-typings/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/Formatters/Core/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 48835d4

Please sign in to comment.