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

110
Views
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 answers
Answer question

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 Report
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!