Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

192
Vistas
How get digits after the decimal points in NumberFormat?

Looking for solution to get full currency value including pennies. numberingSystem: 'fullwide' coming with letter spacing when getting full digits. Is there any option to get full digit with currency code in NumberFormat() ?

Expected behaviour: €56.123456

const CurrencyFormat = (amount = 0, currency = 'eur', digitLength = 'latn') => {
  return new Intl.NumberFormat('en-GB', {
    style: 'currency',
    currency: currency,
    numberingSystem: digitLength,
  }).format(amount)
};

console.log(CurrencyFormat(56.123456, 'eur', 'fullwide'));
console.log(CurrencyFormat(56.123456));

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

Add a maximumFractionDigits property to the options with the number of fractional digits you want to permit.

const CurrencyFormat = (amount = 0, currency = 'eur', digitLength = 'latn') => {
  return new Intl.NumberFormat('en-GB', {
    style: 'currency',
    currency: currency,
    numberingSystem: digitLength,
    maximumFractionDigits: 20,
  }).format(amount)
};

console.log(CurrencyFormat(56.123456, 'eur', 'fullwide'));
console.log(CurrencyFormat(56.123456));

I found this by finding the word MaximumFractionDigits in the specification and discovering that it's a property on instances which can be set through the options object..

over 4 years ago · Santiago Trujillo Denunciar

0

maximumFractionDigits helped to get decimal

const CurrencyFormat = (amount = 0, currency = 'eur') => {
  return new Intl.NumberFormat('en-GB', {
    style: 'currency',
    currency: currency,
    maximumFractionDigits: amount.toString().length,
  }).format(amount)
};

console.log(CurrencyFormat(56.123456, 'eur', 'fullwide'));
console.log(CurrencyFormat(56.123456));

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda