|
![](/i/fill.gif) |
"Philippe Lhoste" <Phi### [at] GMX net> wrote:
>
> printf("There is %d object%s\n", objNb, objNb > 1 ? "s" : "");
>
> Alternatives: use two printf (may be better if you need to localize it,
some
> languages may not use the same plural rules) or an intermediate variable.
> I don't like much the "object(s)" syntax when I can avoid it. Even less
the
> "1 objects" form...
"Have no fear of perfection: you'll never reach it!" :-)
IMHO in this particular case two printf()s would be better than the
altogether correct
printf("There %s %d object%s\n", objNb > 1 ? "are" : "is", objNb, objNb > 1
? "s" : "");
BTW, can't there be no objects at all? ;-)
Follow-ups to povray.off-topic.
Post a reply to this message
|
![](/i/fill.gif) |