Friday, January 21, 2011

JavaScript culture sensitive currency formatting

How can i format currency related data in a manner that is culture aware in JavaScript?

  • Dojo has a currency formatter that's locale aware.

    If you don't want to include Dojo in your project just for this function, then perhaps you can localize the currency in your back-end?

    georgebrock : I believe the Dojo currecy formatting is based on XML data from the Unicode Common Locale Data Repository (http://unicode.org/cldr). While Dojo will do the hard work for you, if you don't want to use it you can get the raw data from there.
    From sherbang
  • Since I'm using ASP.NET 3.5 is there an equivalent in Microsoft's Ajax Framework?

  • there is a Number.localeFormat function but I'm not sure it's what your after

    http://msdn.microsoft.com/en-gb/library/bb310813.aspx

    Jan Willem B : this is an ASP.NET extension function, not native JS

0 comments:

Post a Comment