// returns the short date representation of 't' for locale
FmtDateShort(ttime.Time)string
// returns the medium date representation of 't' for locale
FmtDateMedium(ttime.Time)string
// returns the long date representation of 't' for locale
FmtDateLong(ttime.Time)string
// returns the full date representation of 't' for locale
FmtDateFull(ttime.Time)string
// returns the short time representation of 't' for locale
FmtTimeShort(ttime.Time)string
// returns the medium time representation of 't' for locale
FmtTimeMedium(ttime.Time)string
// returns the long time representation of 't' for locale
FmtTimeLong(ttime.Time)string
// returns the full time representation of 't' for locale
FmtTimeFull(ttime.Time)string
}
// String returns the string value of PluralRule
func(pPluralRule)String()string{
switchp{
casePluralRuleZero:
returnpluralsString[7:11]
casePluralRuleOne:
returnpluralsString[11:14]
casePluralRuleTwo:
returnpluralsString[14:17]
casePluralRuleFew:
returnpluralsString[17:20]
casePluralRuleMany:
returnpluralsString[20:24]
casePluralRuleOther:
returnpluralsString[24:]
default:
returnpluralsString[:7]
}
}
//
// Precision Notes:
//
// must specify a precision >= 0, and here is why https://play.golang.org/p/LyL90U0Vyh
//
// v := float64(3.141)
// i := float64(int64(v))
//
// fmt.Println(v - i)
//
// or
//
// s := strconv.FormatFloat(v-i, 'f', -1, 64)
// fmt.Println(s)
//
// these will not print what you'd expect: 0.14100000000000001
// and so this library requires a precision to be specified, or
// inaccurate plural rules could be applied.
//
//
//
// n - absolute value of the source number (integer and decimals).
// i - integer digits of n.
// v - number of visible fraction digits in n, with trailing zeros.
// w - number of visible fraction digits in n, without trailing zeros.
// f - visible fractional digits in n, with trailing zeros.
// t - visible fractional digits in n, without trailing zeros.
//
//
// Func(num float64, v uint64) // v = digits/precision and prevents -1 as a special case as this can lead to very unexpected behaviour, see precision note's above.
//
// n := math.Abs(num)
// i := int64(n)
// v := v
//
//
// w := strconv.FormatFloat(num-float64(i), 'f', int(v), 64) // then parse backwards on string until no more zero's....
// f := strconv.FormatFloat(n, 'f', int(v), 64) // then turn everything after decimal into an int64
// t := strconv.FormatFloat(n, 'f', int(v), 64) // then parse backwards on string until no more zero's....
//
//
//
// General Inclusion Rules
// - v will always be available inherently
// - all require n
// - w requires i
//
// W returns the number of visible fraction digits in N, without trailing zeros.