The example left out the "precision" parameter, reported values where
wrong (values are rounded, not truncated). The precision parameter is
ignored for values less than 1000 resp. 1024.
Details
- Reviewers
dhaumann - Group Reviewers
Frameworks - Commits
- R244:59dc873bcbe1: Correct KFormat::formatBytes examples
make test
Diff Detail
- Repository
- R244 KCoreAddons
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Then explain why it works? Actually the former behaviour is what I'd expect.
src/lib/util/kformat.h | ||
---|---|---|
188 | What's "resp."? |
src/lib/util/kformat.h | ||
---|---|---|
188 | respectively |
The given example is just plain wrong. It does not work, it is just some false prosa.
The given example is just plain wrong. It does not work, it is just some false prosa.
Fair enough, yet the API user may want to be able to understand what's the logic behind it, so if it can be explained on the documentation that could be useful.
src/lib/util/kformat.h | ||
---|---|---|
188 | Please use the full word. |
What is "it"?
This patch does not change any behaviour, it just ensures the documentation matches reality.
autotests/kformattest.cpp | ||
---|---|---|
37 | See here for handling of precision for small values. Or read the code in kformatprivate.cpp. |
Don't make me read the code. You are updating documentation, the documentation itself needs to offer such information.
I was referring to you vague formulation "understand what's the logic behind it". Apparently you need some clarification for "something". Why don't you tell what "something" is?
Instead of accepting a documentation *fix*, you are nitpicking about something, but you do not really tell what you don't like.
The example code neither compiles, nor does the output - after fixing the broken code - match the output from the documentation.
I think this is an improvement. Even if it can be improved even more, I believe it is better to push this instead of postponing a commit.