From: Samual Lenks Date: Sun, 24 Feb 2013 20:17:30 +0000 (-0500) Subject: Fix count_append, add more comments for it X-Git-Tag: xonotic-v0.7.0~62^2~23^2~130 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=45f34e1f7d0b156cd3f715d75178bf02fcf667a1;p=xonotic%2Fxonotic-data.pk3dir.git Fix count_append, add more comments for it --- diff --git a/qcsrc/common/util.qc b/qcsrc/common/util.qc index c33466633..c5a8c6446 100644 --- a/qcsrc/common/util.qc +++ b/qcsrc/common/util.qc @@ -2612,10 +2612,12 @@ string count_append(float interval, string zeroth, string first, string second, // to accomodate all languages unless we do a specific function for each one... // and since that's not technically feasible/practical, this is all we've got folks. - string timestring = sprintf("%d", interval); - float lastnum = stof(substring(timestring, (strlen(timestring) - 1), 1)); - - switch(lastnum) + // Basically, it just allows you to represent a number or count in different ways + // depending on the number... like, with count_ordinal macro in util.qh you can + // provide integers and retrieve 1st, 2nd, 3rd, 4th, ... nth ordinal numbers in a + // clean and simple way. You can also use count_seconds in the same fashion. + + switch(floor(interval)) { case 0: return sprintf(zeroth, interval); case 1: