Formatting torrent ratio as floating point number - no scientific notation
ClosedPublic

Authored by novakzdenek on Jul 8 2018, 4:37 PM.

Details

Summary

'g' format uses exponential notation when numbers are too big or too small, 'f' keeps numbers in 0.00 format all the time

BUG: 395525

before:

after:

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped
novakzdenek requested review of this revision.Jul 8 2018, 4:37 PM
novakzdenek created this revision.
novakzdenek edited the summary of this revision. (Show Details)
novakzdenek retitled this revision from using 'f' float format instead of 'g' for torrent ratio to using 'f' float format instead of 'g' for torrent upload/download ratio.Jul 8 2018, 6:34 PM
novakzdenek edited the summary of this revision. (Show Details)Jul 10 2018, 6:04 PM
novakzdenek edited the summary of this revision. (Show Details)
novakzdenek retitled this revision from using 'f' float format instead of 'g' for torrent upload/download ratio to Using 'f' float format instead of 'g' for torrent upload/download ratio.Jul 10 2018, 6:07 PM
novakzdenek retitled this revision from Using 'f' float format instead of 'g' for torrent upload/download ratio to Formatting torrent ratio as floating point number - no scientific notation.Jul 10 2018, 6:09 PM
novakzdenek edited the summary of this revision. (Show Details)

Looks good to me, but I think you forgot to specify any reviewers. There isn't an official KTorrent project here on Phabricator, but you could probably add some developers who have contributed to KTorrent in the past few months (@dvratil maybe?).

Also, congrats to your first patch here! Let's hope that there are many more to come.

stikonas requested changes to this revision.EditedJul 10 2018, 6:45 PM

Looks good but can you also check other cases of porting from KLocale::formatNumber to QLocale.

grep -R \'g\' returns a few more strings and at least some of them are the same share ratio.

This revision now requires changes to proceed.Jul 10 2018, 6:45 PM
novakzdenek updated this revision to Diff 38048.EditedJul 19 2018, 3:54 AM

Replace all remaining occurences of 'g' with 'f', so no scientific notation is used in user environment.

stikonas accepted this revision.Jul 19 2018, 10:48 PM

Thanks!

This revision is now accepted and ready to land.Jul 19 2018, 10:48 PM

Hi again. I'm assuming you don't have kde git commit access yet (if you do. please commit). If not, I can commit it for you but I need name, surname and email for that. I can see name and surname in your phabricator account but I need email too.

Hi again. I'm assuming you don't have kde git commit access yet (if you do. please commit). If not, I can commit it for you but I need name, surname and email for that. I can see name and surname in your phabricator account but I need email too.

Hi. My e-mail is andowero@seznam.cz
Thanks for reviewing my patch.