forked from DGNum/gestioCOF
better pluralize
This commit is contained in:
parent
fc2de20ab8
commit
02735642f1
1 changed files with 3 additions and 2 deletions
|
@ -140,6 +140,7 @@ function requestAuth(data, callback, focus_next = null) {
|
||||||
}
|
}
|
||||||
|
|
||||||
String.prototype.pluralize = function(count, irreg_plural = false) {
|
String.prototype.pluralize = function(count, irreg_plural = false) {
|
||||||
plural = irreg_plural ? irreg_plural : this + 's' ;
|
if (Math.abs(count) >= 2)
|
||||||
return (count==1 ? this : plural) ;
|
return irreg_plural ? irreg_plural : this+'s' ;
|
||||||
|
return this ;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue