Need it formattted to add a comma

i have this now, but it just displays the numbers like this 5000 without no comma how do i make a comma so it be 5,000

<div id="ftssulowhigh1">
<script>
document.getElementById("ftssulowhigh1").innerHTML = ( {BIDTOTAL_FTSSU} / {TOTAL_FTSSU_USER1} ) * {HOUSE_COMMISSION} > {MINIMUM_BID} ? ' <div id="tsuscore1"></div>' : '{WILLMINBID}';
                            
var x =  {BIDTOTAL_FTSSU} / {TOTAL_FTSSU_USER1} * {HOUSE_COMMISSION} ;
document.getElementById("tsuscore1").innerHTML = x;
 </script>
 </div>

thanks

Sounds like a job for Intl.NumberFormat
(look at the examples)

2 Likes

yeah seen ,not really sure about integration in my mine already

Here’s how to use it:

var number = 3500;

console.log(new Intl.NumberFormat().format(number));
// → '3,500' if in US English locale
3 Likes

didn’t work

Do they use commas in the US? Here in Canada we stopped using commas with numbers years ago. Could that be why you are not getting the result you want for the US locale?

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.