? Failure

User tests: Successful: Unsuccessful:

avatar demis-palma
demis-palma
27 Feb 2014

Formatting numeric values sometimes involves decimals separator and thousands separator.
A wide variety of formats exists in the world (see http://en.wikipedia.org/wiki/Thousands_separator#Digit_grouping), but currently Joomla only uses the North American format, where the decimals separator is a mark and the thousands separator is a comma (2,000.5 MB). For example, European format is the opposite (2.000,5 MB).
Even worse, this format is hardcoded into the code so that it can't be easily changed.

This contribute removes the constants "." and "," used along the Joomla code, and introduces the use of DECIMALS_SEPARATOR and THOUSANDS_SEPARATOR language strings, which will be localized by the language Teams.

Tracker: http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=33359&start=0

avatar demis-palma demis-palma - open - 27 Feb 2014
avatar demis-palma demis-palma - change - 27 Feb 2014
The description was changed
Description <p>Formatting numeric values sometimes involves decimals separator and thousands separator.<br> A wide variety of formats exists in the world (see <a href="http://en.wikipedia.org/wiki/Thousands_separator#Digit_grouping">http://en.wikipedia.org/wiki/Thousands_separator#Digit_grouping</a>), but currently Joomla only uses the American format, where the decimals separator is a mark and the thousands separator is a comma (2,000.5 MB). For example, European format is the opposite (2.000,5 MB).<br> Even worse, this format is hardcoded into the code so that it can't be easily changed.</p> <p>This contribute removes the constants "." and "," used along the Joomla code, and introduces the use of DECIMALS_SEPARATOR and THOUSANDS_SEPARATOR language strings, which will be localized by the language Teams.</p> <p>Formatting numeric values sometimes involves decimals separator and thousands separator.<br> A wide variety of formats exists in the world (see <a href="http://en.wikipedia.org/wiki/Thousands_separator#Digit_grouping">http://en.wikipedia.org/wiki/Thousands_separator#Digit_grouping</a>), but currently Joomla only uses the American format, where the decimals separator is a mark and the thousands separator is a comma (2,000.5 MB). For example, European format is the opposite (2.000,5 MB).<br> Even worse, this format is hardcoded into the code so that it can't be easily changed.</p> <p>This contribute removes the constants "." and "," used along the Joomla code, and introduces the use of DECIMALS_SEPARATOR and THOUSANDS_SEPARATOR language strings, which will be localized by the language Teams.</p> <p>Tracker: <a href="http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&amp;tracker_item_id=33359&amp;start=0">http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&amp;tracker_item_id=33359&amp;start=0</a></p>
Labels Added: ?
avatar Bakual
Bakual - comment - 27 Feb 2014

Here in Switzerland we usually even use 2'000,5 MB :smile:
Is there a tracker item for this? If not can you please create one and reference it here?

When testing: Make sure you add the two new strings to your language file, otherwise it will still use the english format from fallback.

Test success: After applying patch and adding the language strings I saw the changed format in the article version modal, the com_finder statistics view and the debug information (memory usage).
I don't know where the change in the cache helper class could be tested, but code looks good there as well.

Thanks for coding this!

avatar demis-palma
demis-palma - comment - 27 Feb 2014

It's a pleasure. The tracker exists, an I've updated the first comment.

Unfortunately there is a problem with a test unit. I have omitted modifications on modal.php but the system probably have taken it from my previous pull request.
It seems that the test fails because the test itself doesn't accept thousands separator on Byte numbers. :(

avatar Bakual
Bakual - comment - 27 Feb 2014

The error is because you made a change to braries/cms/html/number.php. Before it just rounded the number and you are now formatting it as well.
So either don't change that behavior here, or update the unit test as well.

avatar demis-palma
demis-palma - comment - 27 Feb 2014

Sorry, I'm not experienced. I've have tried to exclude the modifications to number.php but I am unable.

avatar Bakual
Bakual - comment - 27 Feb 2014

You can just revert the changes by copying from an original file and then commit that. This will remove the changes from this PR.

avatar demis-palma
demis-palma - comment - 27 Feb 2014

Unable to revert since I already deleted my fork.
I've just submitted another pull request: "Added support for localized numeric format, 3rd attempt"
Would you please be so kind to confirm if I submit it the right way? Thanks!

avatar infograf768
infograf768 - comment - 28 Feb 2014

New PR is here
#3202

closing this one

avatar infograf768 infograf768 - change - 28 Feb 2014
Status New Closed
Closed_Date 0000-00-00 00:00:00 2014-02-28 08:57:26
avatar infograf768 infograf768 - close - 28 Feb 2014
avatar infograf768 infograf768 - close - 28 Feb 2014
avatar demis-palma
demis-palma - comment - 28 Feb 2014

That's correct. The new PR passes the tests.

Add a Comment

Login with GitHub to post a comment