Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

264
Views
Usando Intl.NumberFormat, ¿es posible tener tres minIntegerDigits que no sean cero?

Cuando se usa notación científica, escribir 1000 g es lo mismo que 1 kg.

Al usar Intl.NumberFormat con la notación compacta y el estilo de moneda, cambia automáticamente de £ 999 a £ 1k.

Al usar también la propiedad minIntegerDigits=3, esperaba que esperara hasta tener tres dígitos enteros para cambiar, por lo que sería de £ 99,999 a £ 100k. En su lugar, agrega ceros a la izquierda, cambiando de £ 999 a £ 001k.

¿Es posible lograr los siguientes formatos:

£ 99,999.99 luego £ 100.00k

£ 9,999.99k luego £ 10.00M

£ 9,999.99M luego £ 10.00B

? O al menos algo parecido.

Pensé en dividir el número para obtener el tamaño entero que necesito, luego combinar la salida de formatToParts tomando el "literal" de uno y las partes "entero" y "fracción" de otro. Pero se siente demasiado desordenado. (pseudocódigo, algo así como)

 numericalParts = formatToParts(value/1000) semanticalParts = formatToParts(1000) return numericalParts.integer + numericalParts.fraction + semanticalParts.literal + semanticalParts.currency
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!