Skip to content

Support Custom Number Formats #88

jamiemthomas opened this Issue Jan 11, 2012 · 4 comments

4 participants


Currently globalize supports standard formats for dates and numbers and custom formats just for dates. Often it is nice to be able to specify custom formats for numbers as well, such as $#,##0.00;-$#,##0.00;- for currency instead of using the accounting syntax. Please round out this library by providing full support for both standard and custom format strings for numeric types.


+1, it really is necessary in some cases.

A plugin that already handles this functionality (although not perfectly) is, perhaps it could be useful as starting point.


I would recommend to implement what is described below. Taken from

For example, when you're talking a signing bonus for a new job, you may write your desired signing bonus as "$24k", with the "k" representing "thousands". This type of abbreviation is common in the US, with "k" for thousands, "M" for millions, and "B" for billions. Unfortunately, this is not possible in the Globalize plugin formatting right now, without writing your own Culture object to do so.


I started to implement custom numeric formats in my fork.
Currently it fails several tests and it's definitely not ready to be used, but very simple formats such as "#,###.0000" should be working.

I will update this issue with a pull request once it's stable enough.

This was referenced Jun 27, 2012
jQuery Foundation member
rxaviers commented Jun 3, 2014

Globalize 1.x follows CLDR. So, I am closing this bug. Please, feel free to add new comments in case you think this is still an issue.


@rxaviers rxaviers closed this Jun 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.