Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 9b0d8dc

Browse files
committed
fix plural text with negative value
1 parent d1d4ebf commit 9b0d8dc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/utils/notifications.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,14 @@ const handlebarsFallbackHelper = (value, fallbackValue) => {
6666
* ```
6767
* {{pluralize count resource resources}}
6868
* ```
69-
* Will output `resource` if `count` equals or less than 1; otherwise `resources`
69+
* Will output `resource` if `count` equals 0 or 1; otherwise `resources`
7070
*
7171
* @param {Number} count quantity
7272
* @param {String} single noun
7373
* @param {String} plural nouns
7474
*/
7575
const handlebarsPluralizeHelper = (number, single, plural) => {
76-
return number > 1 ? plural : single;
76+
return Math.abs(number) > 1 ? plural : single;
7777
};
7878

7979
// register handlebars helpers

0 commit comments

Comments
 (0)