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

265
Vistas
Using Intl.NumberFormat, is it possible to have three minIntegerDigits that are non-zero?

When using scientific notation, writing 1000g is the same as 1kg.

When using Intl.NumberFormat with the compact notation and currency style, it switches automatically from £999 to £1k.

When using also the property minIntegerDigits=3, I expected it to wait until having three integer digits to switch, so it would be from £99,999 to £100k. Instead it adds leading zeros, switching from £999 to £001k.

Is it possible to achieve the following formats:

£99,999.99 then £100.00k

£9,999.99k then £10.00M

£9,999.99M then £10.00B

? Or at least something similar.

My thought was to divide the number to get it in the integer size I need, then combine the output of formatToParts taking the "literal" from one and the "integer" and "fraction" parts from another. But it just feels too messy. (pseudo-code, something like)

numericalParts = formatToParts(value/1000)
semanticalParts = formatToParts(1000)

return numericalParts.integer + numericalParts.fraction + semanticalParts.literal + semanticalParts.currency


about 4 years ago · Juan Pablo Isaza
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