diff options
author | joeybloggs <Dean.Karn@gmail.com> | 2016-08-11 05:25:55 +0300 |
---|---|---|
committer | joeybloggs <Dean.Karn@gmail.com> | 2016-08-11 05:25:55 +0300 |
commit | df0d272ef2250baaad947ff65501398623365e61 (patch) | |
tree | 67905e5f9735420445a174eab98d3a42a4b3be43 /en_US | |
parent | f81dd14d3cd97e875a6241cf395dae384457c455 (diff) |
add range plural rules + expose Ordinal + Cardinal functions
Diffstat (limited to 'en_US')
-rw-r--r-- | en_US/en_US.go | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/en_US/en_US.go b/en_US/en_US.go index 0d32e68a..adfe5209 100644 --- a/en_US/en_US.go +++ b/en_US/en_US.go @@ -48,8 +48,8 @@ func (en *en_US) PluralsOrdinal() []locales.PluralRule { return en.pluralsOrdinal } -// cardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'en_US' -func (en *en_US) cardinalPluralRule(num float64, v uint64) locales.PluralRule { +// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'en_US' +func (en *en_US) CardinalPluralRule(num float64, v uint64) locales.PluralRule { n := math.Abs(num) i := int64(n) @@ -61,8 +61,8 @@ func (en *en_US) cardinalPluralRule(num float64, v uint64) locales.PluralRule { return locales.PluralRuleOther } -// ordinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'en_US' -func (en *en_US) ordinalPluralRule(num float64, v uint64) locales.PluralRule { +// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'en_US' +func (en *en_US) OrdinalPluralRule(num float64, v uint64) locales.PluralRule { n := math.Abs(num) nMod10 := math.Mod(n, 10) @@ -78,3 +78,8 @@ func (en *en_US) ordinalPluralRule(num float64, v uint64) locales.PluralRule { return locales.PluralRuleOther } + +// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'en_US' +func (en *en_US) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule { + return locales.PluralRuleOther +} |