0

Number 56675.456

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

using String.localeFormat() in JQuery

Expected Result: $56675.46

JimmyPena
  • 8,694
  • 6
  • 43
  • 64
  • `String.localeFormat()` is not a jQuery / JavaScript function (i think its .Net) – Manse Jul 17 '12 at 07:34
  • possible duplicate of [Javascript - convert to European locale](http://stackoverflow.com/questions/5314237/javascript-convert-to-european-locale) <- there are some great answers to this question - a starting point at least – Manse Jul 17 '12 at 07:34
  • You're probably thinking of the _JavaScript_ `Number.toLocaleString()` function (see the question ManseUK linked to). jQuery doesn't have any number formatting methods (that I know of). – nnnnnn Jul 17 '12 at 07:42

1 Answers1

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

convert(56675.456)

demo

Ram
  • 143,282
  • 16
  • 168
  • 197