Bala Murugan
Bala Murugan

Reputation: 1

How to format number to a currency format using String.localeFormat() using jquery?

Number 56675.456

I want to format this number with Format : {0:$###.##}

using String.localeFormat() in JQuery

Expected Result: $56675.46

Upvotes: 0

Views: 1340

Answers (1)

Ram
Ram

Reputation: 144729

function convert(num) {    
  return "$" + (num.toFixed(2));
}

convert(56675.456)

demo

Upvotes: 1

Related Questions