sushi icon indicating copy to clipboard operation
sushi copied to clipboard

Add KWD to the list of currencies

Open j2p9 opened this issue 3 years ago • 1 comments

j2p9 avatar May 30 '22 13:05 j2p9

Hey @j2p9 , this project uses numbro internally...

If you can add the currency on numbro that would be better. https://github.com/BenjaminVanRyseghem/numbro/tree/develop/languages

but i can also add the language config within the project if you send me config. here's a reference for the config json.

{
  languageTag: 'fil-PH',
  delimiters: {
    thousands: ',',
    decimal: '.',
  },
  abbreviations: {
    thousand: 'k',
    million: 'm',
    billion: 'b',
    trillion: 't',
  },
  ordinal: (number) => {
    let b = number % 10;
    // eslint-disable-next-line no-bitwise
    return ~~((number % 100) / 10) === 1
      ? 'th'
      : b === 1
      ? 'st'
      : b === 2
      ? 'nd'
      : b === 3
      ? 'rd'
      : 'th';
  },
  currency: {
    position: 'prefix',
    symbol: '₱',
    code: 'PHP',
  },
  currencyFormat: {
    thousandSeparated: true,
    totalLength: 4,
    spaceSeparated: true,
    spaceSeparatedCurrency: true,
    average: true,
  },
  formats: {
    fourDigits: {
      totalLength: 4,
      spaceSeparated: true,
      average: true,
    },
    fullWithTwoDecimals: {
      thousandSeparated: true,
      mantissa: 2,
    },
    fullWithTwoDecimalsNoCurrency: {
      mantissa: 2,
      thousandSeparated: true,
    },
    fullWithNoDecimals: {
      output: 'currency',
      thousandSeparated: true,
      mantissa: 0,
    },
  },
}

jerameel avatar Jun 05 '22 13:06 jerameel

Closing this for now, will wait for updates on numbro core lib.

jerameel avatar Sep 21 '22 06:09 jerameel