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

111
Vistas
Displaying javascript calculated variable output as currency

I currently have a variable that is made up of two calculated variables. How ever I need to display the outputted variable as a currency which includes thousand separators.

In this instance, the user inputs the width and length of a room and then the java calculates and tells the user how much the required quantity will be. I will add my code below to help see how this is currently working.

All help would be greatly appreciated. Thanks

Here is the calculation variable:

$price = ($quantity_needed*pricePerTile);
$('#ft-price-res').text("£"+$price.toFixed(3));

The full javascript for this page you can view here: https://jsfiddle.net/3yw4m7kj/

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

e.g.:

$('#ft-price-res').text(Intl.NumberFormat('en-GB', {
   style:'currency', 
   currency:'GBP', 
   minimumFractionDigits:3
}).format($price));

and fairly safe to use : https://caniuse.com/?search=Intl.NumberFormat

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