summaryrefslogtreecommitdiffstats
path: root/vendor/golang.org/x/text/internal/number/number.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/golang.org/x/text/internal/number/number.go')
-rw-r--r--vendor/golang.org/x/text/internal/number/number.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/vendor/golang.org/x/text/internal/number/number.go b/vendor/golang.org/x/text/internal/number/number.go
index 34f4477d0..ea341c796 100644
--- a/vendor/golang.org/x/text/internal/number/number.go
+++ b/vendor/golang.org/x/text/internal/number/number.go
@@ -121,6 +121,15 @@ func (n Info) WriteDigit(dst []byte, asciiDigit rune) int {
return int(n.system.digitSize)
}
+// AppendDigit appends the UTF-8 sequence for n corresponding to the given digit
+// to dst and reports the number of bytes written. dst must be large enough to
+// hold the rune (can be up to utf8.UTFMax bytes).
+func (n Info) AppendDigit(dst []byte, digit byte) []byte {
+ dst = append(dst, n.system.zero[:n.system.digitSize]...)
+ dst[len(dst)-1] += digit
+ return dst
+}
+
// Digit returns the digit for the numbering system for the corresponding ASCII
// value. For example, ni.Digit('3') could return 'δΈ‰'. Note that the argument
// is the rune constant '3', which equals 51, not the integer constant 3.