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_CA | |
parent | f81dd14d3cd97e875a6241cf395dae384457c455 (diff) |
add range plural rules + expose Ordinal + Cardinal functions
Diffstat (limited to 'en_CA')
-rw-r--r-- | en_CA/en_CA.go | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/en_CA/en_CA.go b/en_CA/en_CA.go index 816b41a1..432dc964 100644 --- a/en_CA/en_CA.go +++ b/en_CA/en_CA.go @@ -48,8 +48,8 @@ func (en *en_CA) PluralsOrdinal() []locales.PluralRule { return en.pluralsOrdinal } -// cardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'en_CA' -func (en *en_CA) cardinalPluralRule(num float64, v uint64) locales.PluralRule { +// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'en_CA' +func (en *en_CA) CardinalPluralRule(num float64, v uint64) locales.PluralRule { n := math.Abs(num) i := int64(n) @@ -61,12 +61,12 @@ func (en *en_CA) cardinalPluralRule(num float64, v uint64) locales.PluralRule { return locales.PluralRuleOther } -// ordinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'en_CA' -func (en *en_CA) ordinalPluralRule(num float64, v uint64) locales.PluralRule { +// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'en_CA' +func (en *en_CA) OrdinalPluralRule(num float64, v uint64) locales.PluralRule { n := math.Abs(num) - nMod100 := math.Mod(n, 100) nMod10 := math.Mod(n, 10) + nMod100 := math.Mod(n, 100) if nMod10 == 1 && nMod100 != 11 { return locales.PluralRuleOne @@ -78,3 +78,8 @@ func (en *en_CA) 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_CA' +func (en *en_CA) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule { + return locales.PluralRuleOther +} |