Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
Made use of "kB" vs. "KiB" consistent#10951
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Tobion commentedMay 20, 2014
-1 for the same reason as in#10661 (comment) |
webmozart commentedMay 21, 2014
@Tobion I read and understand that reason. I also initially implemented the However, since the PHP manual explicitly states that it interprets "kilobytes" and "megabytes" as being 2-based, I think the best choice is to stick with that convention. I therefore removed the SI-handling code again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
why are you changing this test ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
"kB" → "KB"
I also changed the Unicode symbol to the explicit hex notation, since PHPStorm broke the symbol when I saved the file for some reason.
Tobion commentedMay 21, 2014
@webmozart But we don't need to continue the mistakes of PHP. |
snoob commentedMay 21, 2014
I agree with@webmozart |
webmozart commentedMay 21, 2014
@Tobion The alternative, which I had implemented, would be to explicitly differentiate between "kB"/"MB"/"GB"/... and "KiB"/"MiB"/"GiB"/... Since the console component displays memory in the 2-based measure (which is the convention), the console output would therefore also change from e.g. I figured that the answer was probably no and removed the code again for that reason, staying in line with PHP's conventions (which were probably picked for the same reason). I don't think there's a benefit in being technically 100% correct here. |
Tobion commentedMay 21, 2014
The memory output is for developers or other technicians. So they either know it or can look it up in 1 second. I'd prefer not to add to the confusion between binary and SI prefixes and once for all make it clear. Otherwise this debate will continue forever. |
Tobion commentedMay 21, 2014
Btw the memory standards even refer to binary prefixes as alternative.http://en.wikipedia.org/wiki/JEDEC_memory_standards#Unit_prefixes_for_semiconductor_storage_capacity |
webmozart commentedMay 21, 2014
Ok. I'd like to hear some more opinions though before changing this back. |
jderusse commentedMay 21, 2014
May be a conflict with this PR#10917 ? |
webmozart commentedMay 22, 2014
Alright, after reviewing#10648,#10917 and#10661, I changed the code and PR description again. We now explicitly differentiate between "kB" and "KiB" to avoid further confusions. In a follow-up PR for the master branch (2.6), the specification of the "maxSize" option in the |
webmozart commentedMay 22, 2014
@fabpot You may want to merge this into 2.3, there are no BC concerns involved except for the text output. |
Tobion commentedMay 22, 2014
+1 now :) |
This PR was merged into the 2.5-dev branch.Discussion----------Made use of "kB" vs. "KiB" consistent| Q | A| ------------- | ---| Bug fix? | no| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets | -| License | MIT| Doc PR | -Continuation of#10661.This PR makes the usage of "kB" and "KiB" consistent across the project. The notations equal the internationally recognized ones:Short form | Long form | Value in Bytes--- | --- | ---B | bytes | 1kB | kilobytes | 1000KiB | kibibytes | 1024MB | megabytes | 1000000MiB | mebibytes | 1048576GB | gigabytes | 1000000000GiB | gibibytes | 1073741824The reason for differentiating between the two is that several users got confused with the current mix (see#10648,#10917,#10661).FileValidator, UploadedFile and the ProgressBar helper were changed accordingly.Follow-up feature request:#10962Commits-------e4c6da5 [Validator] Improved to-string conversion of the file size/size limitbbe1045 [Validator][Console][HttpFoundation] Use "KiB" everywhere (instead of "kB")
Continuation of#10661.
This PR makes the usage of "kB" and "KiB" consistent across the project. The notations equal the internationally recognized ones:
The reason for differentiating between the two is that several users got confused with the current mix (see#10648,#10917,#10661).
FileValidator, UploadedFile and the ProgressBar helper were changed accordingly.
Follow-up feature request:#10962