Author serhiy.storchaka
Recipients Tim.Graham, loewis, mdk, serhiy.storchaka, xiang.zhang
Date 2016-12-04.11:54:52
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1480852492.57.0.0623263999387.issue28692@psf.upfronthosting.co.za>
In-reply-to
Content
round() was used because it is the simplest way to convert fractional numbers to integers that doesn't involve strings-to-integer converting (as in int()). Perhaps math.trunc() looks a little more appropriate. math.ceil() returns a float in 2.7 and is limited by float range. But "1.678 second" don't look more correct than "1.678 seconds". My point is that gettext ability of selecting plural form shouldn't be used for fractional numbers. It seems to me that a fractional number should be formatted with the same form independently from it's value (it can be different from plural forms for integer numbers). Proposed patch adds a deprecating warning for encouraging users to rewrite their code for formatting fractional numbers.
History
Date User Action Args
2016-12-04 11:54:52serhiy.storchakasetrecipients: + serhiy.storchaka, loewis, Tim.Graham, xiang.zhang, mdk
2016-12-04 11:54:52serhiy.storchakasetmessageid: <1480852492.57.0.0623263999387.issue28692@psf.upfronthosting.co.za>
2016-12-04 11:54:52serhiy.storchakalinkissue28692 messages
2016-12-04 11:54:52serhiy.storchakacreate