Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Support Custom Number Formats #88

jamiemthomas opened this Issue · 4 comments

4 participants

Jamie Thomas erethnor Jan Hrabowski Rafael Xavier de Souza
Jamie Thomas

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.

Jan Hrabowski

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
Rafael Xavier de Souza

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.


Rafael Xavier de Souza rxaviers closed this
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.