currency parser: thousands separator support #34
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When working with large figures in accounting applications, it's often preferred to format your numbers with grouped thousands through thousands separators. In example, presenting a large figure like $1386915 as $1,386,915 instead, makes it much more readable to the end-user.
Most server-side scripting languages and spreadsheet applications provide all the necessary functionality for the purpose, in example:
http://php.net/manual/en/function.number-format.php
http://office.microsoft.com/en-001/excel-help/format-numbers-as-currency-HA102749029.aspx
...so many people rely on these functions in their everyday work to format and present their figures properly.
Unfortunately, Tablesorter doesn't provide native support to figures utilizing the aforementioned format, so if a user decides to present financial information formatted with thousands separators, Tablesorter identifies the data type as "currency", but is unable to sort it properly.
Therefore, I went ahead and added some minor modifications, so the currency parser can successfully sort figures, which make a use of thousands separators.
I have already used this functionality in a couple of projects and it works great. I hope it's useful to the community too.
All best,
Marin