Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/locales.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoeybloggs <Dean.Karn@gmail.com>2016-08-16 04:18:40 +0300
committerjoeybloggs <Dean.Karn@gmail.com>2016-08-16 04:18:40 +0300
commit5e30685010ab9c6da8cc729a3e7eab0b1ae964ae (patch)
tree11782ebd7840c5c9bd60cdf318cd98898fb11fc7 /rules.go
parent7a50918c70b219070868048aa533f5b142880103 (diff)
add regular currency logic
Diffstat (limited to 'rules.go')
-rw-r--r--rules.go15
1 files changed, 12 insertions, 3 deletions
diff --git a/rules.go b/rules.go
index 53206372..4a9ff4cf 100644
--- a/rules.go
+++ b/rules.go
@@ -1,6 +1,10 @@
package locales
-import "strconv"
+import (
+ "strconv"
+
+ "github.com/go-playground/locales/currency"
+)
// // ErrBadNumberValue is returned when the number passed for
// // plural rule determination cannot be parsed
@@ -57,16 +61,21 @@ type Translator interface {
// returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for locale
RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) PluralRule
- // returns 'num' with digits/precision of 'v' for 'mr_IN' and handles both Whole and Real numbers based on 'v'
+ // returns 'num' with digits/precision of 'v' for locale and handles both Whole and Real numbers based on 'v'
// returned as a []byte just in case the caller wishes to add more and can help
// avoid allocations; otherwise just cast as string.
FmtNumber(num float64, v uint64) []byte
- // returns 'num' with digits/precision of 'v' for '{{ .Locale }}' and handles both Whole and Real numbers based on 'v'
+ // returns 'num' with digits/precision of 'v' for locale and handles both Whole and Real numbers based on 'v'
// returned as a []byte just in case the caller wishes to add more and can help
// avoid allocations; otherwise just cast as string.
// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
FmtPercent(num float64, v uint64) []byte
+
+ // returns the currency representation of 'num' with digits/precision of 'v' for locale
+ // returned as a []byte just in case the caller wishes to add more and can help
+ // avoid allocations; otherwise just cast as string.
+ FmtCurrency(num float64, v uint64, currency currency.Type) []byte
}
// String returns the string value of PluralRule