-
Notifications
You must be signed in to change notification settings - Fork 1
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The standard symbol for the metric prefix kilo- is k not K (so kB for kilobyte, not KB) #5
Comments
Thanks Andrea, I appreciate you creating the issue, however it would be helpful if you linked a source that verifies this claim so I don't have to Google it myself 😉 |
It turns out both |
Can you recommended an action for resolution? |
Since both are valid, offer the choice of a set with lowercase 'k' and the choice of a set with uppercase 'k'. |
It is a weird issue. Microsoft use upper I don't think there's a clean answer to how they should be used. If you wanted to be thorough i guess you'd need to provide five different sets of prefixes:
That gets pretty messy though. If you really wanted to make everyone happy i guess what you'd do is provide a mechanism for users to define their own units. In addition to addressing this question you would also eliminate one of the two things that make this library English-specific — French users could specify idk if you want it to be that fancy though. If you don't, i would suggest just picking one. |
The consumer already has the ability to define their own decorator, so we're really just talking about making sure the bundled decorators are correct according to their respective sets. The metric/SI prefix for kilo- is Personally, I would like to see each base/set pulled into its own decorator. That would give you something like |
Sorry, i hadn't looked far enough into the decorators to see that you could extend them easily. That does address that. I agree with your second paragraph, having separate pre-defined decorators would be neat. |
Why are separate classes better? |
For my part, it seems like it'd be simplest for the end user if they didn't have to pass in a bunch of constants all over the place. On balance, though, it might not work. The decorators are designed to accept the base from the formatter (which certainly seems reasonable — otherwise they'd have to know about the mathematics, right? which would make them... not decorators), so it doesn't really make sense to have ones that're inherently tied to a particular base. What if someone did like
for example? It wouldn't make any sense. I guess you could have your I don't know |
As pointed out on reddit: https://www.reddit.com/r/PHP/comments/3yq3yx/byteformatter_is_a_psr2_compliant_library_that/cygfps8
The text was updated successfully, but these errors were encountered: