User tests: Successful: Unsuccessful:
Pull Request for New Issue.
As discussed in joomla/joomla-websites#765 JHtmlNumber::bytes() is returning the number format always in english format.
This PR makes it return the format in the current language, using the languages packs DECIMALS_SEPARATOR and THOUSANDS_SEPARATOR variables for formatting the number.
echo JHtmlNumber::bytes(1).'<br/>';
echo JHtmlNumber::bytes(1024).'<br/>';
echo JHtmlNumber::bytes(1024*1024).'<br/>';
echo JHtmlNumber::bytes(1024*1024*1024).'<br/>';
echo JHtmlNumber::bytes(1024*1024*1024*1024).'<br/>';/language/xx-XX/xx-XX.ini file).None.
| Status | New | ⇒ | Pending |
| Category | ⇒ | Libraries |
| Labels |
Added:
?
|
||
| Category | Libraries | ⇒ | Libraries Unit Tests |
| Labels |
Added:
?
|
||
| Labels |
Removed:
?
|
||
I have tested this item
| Milestone |
Added: |
||
I have tested this item
| Milestone |
Added: |
||
| Status | Pending | ⇒ | Ready to Commit |
| Labels |
Added:
?
|
||
RTC
| Status | Ready to Commit | ⇒ | Fixed in Code Base |
| Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-11-18 16:28:13 |
| Closed_By | ⇒ | wilsonge | |
| Labels | |||
Thanks :)
In English I get:
1.00 b
1.00 kB
1.00 MB
1.00 GB
1.00 TB
and in French
1,00 b
1,00 kB
1,00 MB
1,00 GB
1,00 TB
When I changed the echo to
echo JHtmlNumber::bytes(1000*1024*1024*1024*1024).'<br/>';I got
1 000,00 TB
Which is indeed correct in French.