> [: John Tapsell :] > If the number is small, I want to show "2 seconds" but if it's large I > want like "2.2e4" seconds. > > You're saying that my API needs to require the user to now pass *two* > strings for that?
Well, yes. Two grammar-wise different text fragments (enumerable vs. measurable quantities) are being used in alternation, so each should be represented by its own string. The author of KUnitConversion wanted the same feature, so there too we ended up defining two strings, e.g: setDefaultUnit(UP(Meter, 1, ... ki18nc("amount in units (real)", "%1 meters"), ki18ncp("amount in units (integer)", "%1 meter", "%1 meters") )); (from kdelibs/kunitconversion/length.cpp). In my opinion, however, this alternation is bad style-wise. The display should use either the measurable form throughout (2.0 seconds; 2.2e4 seconds), or the enumerable form throughout (2 seconds; 6 hours 6 minutes). -- Chusslove Illich (Часлав Илић)
signature.asc
Description: This is a digitally signed message part.