In feedback site, in post with only comment, there’s a grammar mistake “1 comments”
Attachments
Comments 3
It isn’t that hard of a coding fix.
js: function commentText(count) {
return ${count} Comment${count === 1 ? '' : 's'};
}
commentText(1); // "1 Comment"
commentText(5); // "5 Comments"
HTML: <span id="comments"></span>
<script>
const count = 1;
document.getElementById("comments").textContent =
count + " Comment" + (count === 1 ? "" : "s");
</script>
Python: def comment_text(count):
return f"{count} Comment{'s' if count != 1 else ''}"
comment_text(1) # "1 Comment"
comment_text(3) # "3 Comments"
int count = 1;
string text = $"{count} Comment{(count == 1 ? "" : "s")}";
C#: int count = 1;
string text = $"{count} Comment{(count == 1 ? "" : "s")}";
PHP: $count = 1;
echo $count . " Comment" . ($count === 1 ? "" : "s");
Logic Form: if count == 1 → "Comment"
else → "Comments."
most of the sites write it like that