internal/number: move all rounding data in one type

Change-Id: If5752ddeee6224a347b4feccd0195f1057bd5397
Reviewed-on: https://go-review.googlesource.com/58410
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
diff --git a/internal/number/decimal.go b/internal/number/decimal.go
index 199c7e4..fd62310 100644
--- a/internal/number/decimal.go
+++ b/internal/number/decimal.go
@@ -25,15 +25,6 @@
 	numModes
 )
 
-// A RoundingContext indicates how a number should be converted to digits.
-type RoundingContext struct {
-	Mode      RoundingMode
-	Increment int32 // if > 0, round to Increment * 10^-Scale
-
-	Precision int32 // maximum number of significant digits.
-	Scale     int32 // maximum number of decimals after the dot.
-}
-
 const maxIntDigits = 20
 
 // A Decimal represents floating point number represented in digits of the base
diff --git a/internal/number/format.go b/internal/number/format.go
index 533a85a..dd703a7 100755
--- a/internal/number/format.go
+++ b/internal/number/format.go
@@ -28,7 +28,6 @@
 type Formatter struct {
 	Pattern
 	Info
-	RoundingContext
 }
 
 func (f *Formatter) init(t language.Tag, index []uint8) {
@@ -89,7 +88,7 @@
 func (f *Formatter) Format(dst []byte, d *Decimal) []byte {
 	var result []byte
 	var postPrefix, preSuffix int
-	if f.MinExponentDigits > 0 {
+	if f.isScientific() {
 		result, postPrefix, preSuffix = appendScientific(dst, f, d)
 	} else {
 		result, postPrefix, preSuffix = appendDecimal(dst, f, d)
@@ -132,22 +131,22 @@
 }
 
 // TODO: just return visible digits.
-func decimalVisibleDigits(f *Formatter, d *Decimal) Decimal {
+func decimalVisibleDigits(r *RoundingContext, d *Decimal) Decimal {
 	if d.NaN || d.Inf {
 		return *d
 	}
 	n := d.normalize()
-	if maxSig := int(f.MaxSignificantDigits); maxSig > 0 {
+	if maxSig := int(r.MaxSignificantDigits); maxSig > 0 {
 		// TODO: really round to zero?
 		n.round(ToZero, maxSig)
 	}
 	digits := n.Digits
 	exp := n.Exp
-	exp += int32(f.Pattern.DigitShift)
+	exp += int32(r.DigitShift)
 
 	// Cap integer digits. Remove *most-significant* digits.
-	if f.MaxIntegerDigits > 0 {
-		if p := int(exp) - int(f.MaxIntegerDigits); p > 0 {
+	if r.MaxIntegerDigits > 0 {
+		if p := int(exp) - int(r.MaxIntegerDigits); p > 0 {
 			if p > len(digits) {
 				p = len(digits)
 			}
@@ -166,8 +165,8 @@
 
 	// Rounding usually is done by convert, but we don't rely on it.
 	numFrac := len(digits) - int(exp)
-	if f.MaxSignificantDigits == 0 && int(f.MaxFractionDigits) < numFrac {
-		p := int(exp) + int(f.MaxFractionDigits)
+	if r.MaxSignificantDigits == 0 && int(r.MaxFractionDigits) < numFrac {
+		p := int(exp) + int(r.MaxFractionDigits)
 		if p <= 0 {
 			p = 0
 		} else if p >= len(digits) {
@@ -179,18 +178,18 @@
 	// set End (trailing zeros)
 	n.End = int32(len(digits))
 	if len(digits) == 0 {
-		if f.MinFractionDigits > 0 {
-			n.End = int32(f.MinFractionDigits)
+		if r.MinFractionDigits > 0 {
+			n.End = int32(r.MinFractionDigits)
 		}
-		if p := int32(f.MinSignificantDigits) - 1; p > n.End {
+		if p := int32(r.MinSignificantDigits) - 1; p > n.End {
 			n.End = p
 		}
 	} else {
-		if end := exp + int32(f.MinFractionDigits); end > n.End {
+		if end := exp + int32(r.MinFractionDigits); end > n.End {
 			n.End = end
 		}
-		if n.End < int32(f.MinSignificantDigits) {
-			n.End = int32(f.MinSignificantDigits)
+		if n.End < int32(r.MinSignificantDigits) {
+			n.End = int32(r.MinSignificantDigits)
 		}
 	}
 	n.Digits = digits
@@ -204,7 +203,7 @@
 	if dst, ok := f.renderSpecial(dst, d); ok {
 		return dst, 0, len(dst)
 	}
-	n := decimalVisibleDigits(f, d)
+	n := decimalVisibleDigits(&f.RoundingContext, d)
 	digits := n.Digits
 	exp := n.Exp
 
@@ -272,7 +271,7 @@
 	return appendAffix(dst, f, suffix, neg), savedLen, len(dst)
 }
 
-func scientificVisibleDigits(f *Formatter, d *Decimal) Decimal {
+func scientificVisibleDigits(r *RoundingContext, d *Decimal) Decimal {
 	if d.NaN || d.Inf {
 		return *d
 	}
@@ -280,12 +279,12 @@
 
 	// Significant digits are transformed by the parser for scientific notation
 	// and do not need to be handled here.
-	maxInt, numInt := int(f.MaxIntegerDigits), int(f.MinIntegerDigits)
+	maxInt, numInt := int(r.MaxIntegerDigits), int(r.MinIntegerDigits)
 	if numInt == 0 {
 		numInt = 1
 	}
-	maxSig := int(f.MaxFractionDigits) + numInt
-	minSig := int(f.MinFractionDigits) + numInt
+	maxSig := int(r.MaxFractionDigits) + numInt
+	minSig := int(r.MinFractionDigits) + numInt
 
 	if maxSig > 0 {
 		// TODO: really round to zero?
@@ -332,7 +331,7 @@
 		return dst, 0, 0
 	}
 	// n := d.normalize()
-	n := scientificVisibleDigits(f, d)
+	n := scientificVisibleDigits(&f.RoundingContext, d)
 	digits := n.Digits
 	exp := n.Exp
 	numInt := int(n.Comma)
diff --git a/internal/number/format_test.go b/internal/number/format_test.go
index 4c47bc5..d7295e0 100755
--- a/internal/number/format_test.go
+++ b/internal/number/format_test.go
@@ -193,7 +193,9 @@
 	}, {
 		pattern: "#,max_int=2",
 		pat: &Pattern{
-			MaxIntegerDigits: 2,
+			RoundingContext: RoundingContext{
+				MaxIntegerDigits: 2,
+			},
 		},
 		test: pairs{
 			"2017": "17",
@@ -201,8 +203,10 @@
 	}, {
 		pattern: "0,max_int=2",
 		pat: &Pattern{
-			MaxIntegerDigits: 2,
-			MinIntegerDigits: 1,
+			RoundingContext: RoundingContext{
+				MaxIntegerDigits: 2,
+				MinIntegerDigits: 1,
+			},
 		},
 		test: pairs{
 			"2000": "0",
@@ -212,8 +216,10 @@
 	}, {
 		pattern: "00,max_int=2",
 		pat: &Pattern{
-			MaxIntegerDigits: 2,
-			MinIntegerDigits: 2,
+			RoundingContext: RoundingContext{
+				MaxIntegerDigits: 2,
+				MinIntegerDigits: 2,
+			},
 		},
 		test: pairs{
 			"2000": "00",
@@ -223,8 +229,10 @@
 	}, {
 		pattern: "@@@@,max_int=2",
 		pat: &Pattern{
-			MaxIntegerDigits:     2,
-			MinSignificantDigits: 4,
+			RoundingContext: RoundingContext{
+				MaxIntegerDigits:     2,
+				MinSignificantDigits: 4,
+			},
 		},
 		test: pairs{
 			"2017": "17.00",
diff --git a/internal/number/pattern.go b/internal/number/pattern.go
index ef7f087..8a3f595 100644
--- a/internal/number/pattern.go
+++ b/internal/number/pattern.go
@@ -48,12 +48,27 @@
 
 	FormatWidth uint16
 
-	RoundIncrement uint32 // Use Min*Digits to determine scale
-	PadRune        rune
-	DigitShift     uint8 // Number of decimals to shift. Used for % and ‰.
+	PadRune rune
+
+	RoundingContext
 
 	GroupingSize [2]uint8
 	Flags        PatternFlag
+}
+
+// A RoundingContext indicates how a number should be converted to digits.
+// It contains all information needed to determine the "visible digits" as
+// required by the pluralization rules.
+type RoundingContext struct {
+	Mode RoundingMode
+
+	Precision int32 // maximum number of significant digits.
+	Scale     int32 // maximum number of decimals after the dot.
+
+	// if > 0, round to Increment * 10^-Scale
+	Increment uint32 // Use Min*Digits to determine scale
+
+	DigitShift uint8 // Number of decimals to shift. Used for % and ‰.
 
 	// Number of digits.
 	// TODO: consider using uint32
@@ -63,7 +78,12 @@
 	MaxFractionDigits    uint8
 	MinSignificantDigits uint8
 	MaxSignificantDigits uint8
-	MinExponentDigits    uint8
+
+	MinExponentDigits uint8
+}
+
+func (r *RoundingContext) isScientific() bool {
+	return r.MinExponentDigits > 0
 }
 
 func (f *Pattern) needsSep(pos int) bool {
@@ -339,7 +359,7 @@
 		p.updateGrouping()
 		return next
 	}
-	p.RoundIncrement = p.RoundIncrement*10 + uint32(r-'0')
+	p.Increment = p.Increment*10 + uint32(r-'0')
 	p.groupingCount++
 	p.MinIntegerDigits++
 	return p.integer
@@ -389,7 +409,7 @@
 func (p *parser) fraction(r rune) state {
 	switch r {
 	case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9':
-		p.RoundIncrement = p.RoundIncrement*10 + uint32(r-'0')
+		p.Increment = p.Increment*10 + uint32(r-'0')
 		p.MinFractionDigits++
 		p.MaxFractionDigits++
 	case '#':
diff --git a/internal/number/pattern_test.go b/internal/number/pattern_test.go
index 97ff64d..f551456 100644
--- a/internal/number/pattern_test.go
+++ b/internal/number/pattern_test.go
@@ -22,96 +22,122 @@
 }, {
 	"0",
 	&Pattern{
-		FormatWidth:      1,
-		MinIntegerDigits: 1,
+		FormatWidth: 1,
+		RoundingContext: RoundingContext{
+			MinIntegerDigits: 1,
+		},
 	},
 }, {
 	"+0",
 	&Pattern{
-		Affix:            "\x01+\x00",
-		FormatWidth:      2,
-		MinIntegerDigits: 1,
+		Affix:       "\x01+\x00",
+		FormatWidth: 2,
+		RoundingContext: RoundingContext{
+			MinIntegerDigits: 1,
+		},
 	},
 }, {
 	"0+",
 	&Pattern{
-		Affix:            "\x00\x01+",
-		FormatWidth:      2,
-		MinIntegerDigits: 1,
+		Affix:       "\x00\x01+",
+		FormatWidth: 2,
+		RoundingContext: RoundingContext{
+			MinIntegerDigits: 1,
+		},
 	},
 }, {
 	"0000",
 	&Pattern{
-		FormatWidth:      4,
-		MinIntegerDigits: 4,
+		FormatWidth: 4,
+		RoundingContext: RoundingContext{
+			MinIntegerDigits: 4,
+		},
 	},
 }, {
 	".#",
 	&Pattern{
-		FormatWidth:       2,
-		MaxFractionDigits: 1,
+		FormatWidth: 2,
+		RoundingContext: RoundingContext{
+			MaxFractionDigits: 1,
+		},
 	},
 }, {
 	"#0.###",
 	&Pattern{
-		FormatWidth:       6,
-		MinIntegerDigits:  1,
-		MaxFractionDigits: 3,
+		FormatWidth: 6,
+		RoundingContext: RoundingContext{
+			MinIntegerDigits:  1,
+			MaxFractionDigits: 3,
+		},
 	},
 }, {
 	"#0.######",
 	&Pattern{
-		FormatWidth:       9,
-		MinIntegerDigits:  1,
-		MaxFractionDigits: 6,
+		FormatWidth: 9,
+		RoundingContext: RoundingContext{
+			MinIntegerDigits:  1,
+			MaxFractionDigits: 6,
+		},
 	},
 }, {
 	"#,0",
 	&Pattern{
-		FormatWidth:      3,
-		GroupingSize:     [2]uint8{1, 0},
-		MinIntegerDigits: 1,
+		FormatWidth:  3,
+		GroupingSize: [2]uint8{1, 0},
+		RoundingContext: RoundingContext{
+			MinIntegerDigits: 1,
+		},
 	},
 }, {
 	"#,0.00",
 	&Pattern{
-		FormatWidth:       6,
-		GroupingSize:      [2]uint8{1, 0},
-		MinIntegerDigits:  1,
-		MinFractionDigits: 2,
-		MaxFractionDigits: 2,
+		FormatWidth:  6,
+		GroupingSize: [2]uint8{1, 0},
+		RoundingContext: RoundingContext{
+			MinIntegerDigits:  1,
+			MinFractionDigits: 2,
+			MaxFractionDigits: 2,
+		},
 	},
 }, {
 	"#,##0.###",
 	&Pattern{
-		FormatWidth:       9,
-		GroupingSize:      [2]uint8{3, 0},
-		MinIntegerDigits:  1,
-		MaxFractionDigits: 3,
+		FormatWidth:  9,
+		GroupingSize: [2]uint8{3, 0},
+		RoundingContext: RoundingContext{
+			MinIntegerDigits:  1,
+			MaxFractionDigits: 3,
+		},
 	},
 }, {
 	"#,##,##0.###",
 	&Pattern{
-		FormatWidth:       12,
-		GroupingSize:      [2]uint8{3, 2},
-		MinIntegerDigits:  1,
-		MaxFractionDigits: 3,
+		FormatWidth:  12,
+		GroupingSize: [2]uint8{3, 2},
+		RoundingContext: RoundingContext{
+			MinIntegerDigits:  1,
+			MaxFractionDigits: 3,
+		},
 	},
 }, {
 	// Ignore additional separators.
 	"#,####,##,##0.###",
 	&Pattern{
-		FormatWidth:       17,
-		GroupingSize:      [2]uint8{3, 2},
-		MinIntegerDigits:  1,
-		MaxFractionDigits: 3,
+		FormatWidth:  17,
+		GroupingSize: [2]uint8{3, 2},
+		RoundingContext: RoundingContext{
+			MinIntegerDigits:  1,
+			MaxFractionDigits: 3,
+		},
 	},
 }, {
 	"#E0",
 	&Pattern{
-		FormatWidth:       3,
-		MaxIntegerDigits:  1,
-		MinExponentDigits: 1,
+		FormatWidth: 3,
+		RoundingContext: RoundingContext{
+			MaxIntegerDigits:  1,
+			MinExponentDigits: 1,
+		},
 	},
 }, {
 	// At least one exponent digit is required. As long as this is true, one can
@@ -121,30 +147,36 @@
 }, {
 	"0E0",
 	&Pattern{
-		FormatWidth:       3,
-		MinIntegerDigits:  1,
-		MinExponentDigits: 1,
+		FormatWidth: 3,
+		RoundingContext: RoundingContext{
+			MinIntegerDigits:  1,
+			MinExponentDigits: 1,
+		},
 	},
 }, {
 	"##00.0#E0",
 	&Pattern{
-		FormatWidth:       9,
-		MinIntegerDigits:  2,
-		MaxIntegerDigits:  4,
-		MinFractionDigits: 1,
-		MaxFractionDigits: 2,
-		MinExponentDigits: 1,
+		FormatWidth: 9,
+		RoundingContext: RoundingContext{
+			MinIntegerDigits:  2,
+			MaxIntegerDigits:  4,
+			MinFractionDigits: 1,
+			MaxFractionDigits: 2,
+			MinExponentDigits: 1,
+		},
 	},
 }, {
 	"#00.0E+0",
 	&Pattern{
-		FormatWidth:       8,
-		Flags:             AlwaysExpSign,
-		MinIntegerDigits:  2,
-		MaxIntegerDigits:  3,
-		MinFractionDigits: 1,
-		MaxFractionDigits: 1,
-		MinExponentDigits: 1,
+		FormatWidth: 8,
+		Flags:       AlwaysExpSign,
+		RoundingContext: RoundingContext{
+			MinIntegerDigits:  2,
+			MaxIntegerDigits:  3,
+			MinFractionDigits: 1,
+			MaxFractionDigits: 1,
+			MinExponentDigits: 1,
+		},
 	},
 }, {
 	"0.0E++0",
@@ -156,45 +188,55 @@
 	// significant digits
 	"@",
 	&Pattern{
-		FormatWidth:          1,
-		MinSignificantDigits: 1,
-		MaxSignificantDigits: 1,
+		FormatWidth: 1,
+		RoundingContext: RoundingContext{
+			MinSignificantDigits: 1,
+			MaxSignificantDigits: 1,
+		},
 	},
 }, {
 	// significant digits
 	"@@@@",
 	&Pattern{
-		FormatWidth:          4,
-		MinSignificantDigits: 4,
-		MaxSignificantDigits: 4,
+		FormatWidth: 4,
+		RoundingContext: RoundingContext{
+			MinSignificantDigits: 4,
+			MaxSignificantDigits: 4,
+		},
 	},
 }, {
 	"@###",
 	&Pattern{
-		FormatWidth:          4,
-		MinSignificantDigits: 1,
-		MaxSignificantDigits: 4,
+		FormatWidth: 4,
+		RoundingContext: RoundingContext{
+			MinSignificantDigits: 1,
+			MaxSignificantDigits: 4,
+		},
 	},
 }, {
 	// Exponents in significant digits mode gets normalized.
 	"@@E0",
 	&Pattern{
-		FormatWidth:       4,
-		MinIntegerDigits:  1,
-		MaxIntegerDigits:  1,
-		MinFractionDigits: 1,
-		MaxFractionDigits: 1,
-		MinExponentDigits: 1,
+		FormatWidth: 4,
+		RoundingContext: RoundingContext{
+			MinIntegerDigits:  1,
+			MaxIntegerDigits:  1,
+			MinFractionDigits: 1,
+			MaxFractionDigits: 1,
+			MinExponentDigits: 1,
+		},
 	},
 }, {
 	"@###E00",
 	&Pattern{
-		FormatWidth:       7,
-		MinIntegerDigits:  1,
-		MaxIntegerDigits:  1,
-		MinFractionDigits: 0,
-		MaxFractionDigits: 3,
-		MinExponentDigits: 2,
+		FormatWidth: 7,
+		RoundingContext: RoundingContext{
+			MinIntegerDigits:  1,
+			MaxIntegerDigits:  1,
+			MinFractionDigits: 0,
+			MaxFractionDigits: 3,
+			MinExponentDigits: 2,
+		},
 	},
 }, {
 	// The significant digits mode does not allow fractions.
@@ -204,73 +246,87 @@
 	//alternative negative pattern
 	"#0.###;(#0.###)",
 	&Pattern{
-		Affix:             "\x00\x00\x01(\x01)",
-		NegOffset:         2,
-		FormatWidth:       6,
-		MinIntegerDigits:  1,
-		MaxFractionDigits: 3,
+		Affix:       "\x00\x00\x01(\x01)",
+		NegOffset:   2,
+		FormatWidth: 6,
+		RoundingContext: RoundingContext{
+			MinIntegerDigits:  1,
+			MaxFractionDigits: 3,
+		},
 	},
 }, {
 	// Rounding increment
 	"1.05",
 	&Pattern{
-		RoundIncrement:    105,
-		FormatWidth:       4,
-		MinIntegerDigits:  1,
-		MinFractionDigits: 2,
-		MaxFractionDigits: 2,
+		FormatWidth: 4,
+		RoundingContext: RoundingContext{
+			Increment:         105,
+			MinIntegerDigits:  1,
+			MinFractionDigits: 2,
+			MaxFractionDigits: 2,
+		},
 	},
 }, {
 	// Rounding increment with grouping
 	"1,05",
 	&Pattern{
-		RoundIncrement:    105,
-		FormatWidth:       4,
-		GroupingSize:      [2]uint8{2, 0},
-		MinIntegerDigits:  3,
-		MinFractionDigits: 0,
-		MaxFractionDigits: 0,
+		FormatWidth:  4,
+		GroupingSize: [2]uint8{2, 0},
+		RoundingContext: RoundingContext{
+			Increment:         105,
+			MinIntegerDigits:  3,
+			MinFractionDigits: 0,
+			MaxFractionDigits: 0,
+		},
 	},
 }, {
 	"0.0%",
 	&Pattern{
-		Affix:             "\x00\x01%",
-		DigitShift:        2,
-		FormatWidth:       4,
-		MinIntegerDigits:  1,
-		MinFractionDigits: 1,
-		MaxFractionDigits: 1,
+		Affix:       "\x00\x01%",
+		FormatWidth: 4,
+		RoundingContext: RoundingContext{
+			DigitShift:        2,
+			MinIntegerDigits:  1,
+			MinFractionDigits: 1,
+			MaxFractionDigits: 1,
+		},
 	},
 }, {
 	"0.0‰",
 	&Pattern{
-		Affix:             "\x00\x03‰",
-		DigitShift:        3,
-		FormatWidth:       4,
-		MinIntegerDigits:  1,
-		MinFractionDigits: 1,
-		MaxFractionDigits: 1,
+		Affix:       "\x00\x03‰",
+		FormatWidth: 4,
+		RoundingContext: RoundingContext{
+			DigitShift:        3,
+			MinIntegerDigits:  1,
+			MinFractionDigits: 1,
+			MaxFractionDigits: 1,
+		},
 	},
 }, {
 	"#,##0.00¤",
 	&Pattern{
-		Affix:             "\x00\x02¤",
-		FormatWidth:       9,
-		GroupingSize:      [2]uint8{3, 0},
-		MinIntegerDigits:  1,
-		MinFractionDigits: 2,
-		MaxFractionDigits: 2,
+		Affix:        "\x00\x02¤",
+		FormatWidth:  9,
+		GroupingSize: [2]uint8{3, 0},
+		RoundingContext: RoundingContext{
+			MinIntegerDigits:  1,
+			MinFractionDigits: 2,
+			MaxFractionDigits: 2,
+		},
 	},
 }, {
 	"#,##0.00 ¤;(#,##0.00 ¤)",
 	&Pattern{Affix: "\x00\x04\u00a0¤\x01(\x05\u00a0¤)",
-		NegOffset:         6,
-		DigitShift:        0,
-		FormatWidth:       10,
-		GroupingSize:      [2]uint8{3, 0},
-		MinIntegerDigits:  1,
-		MinFractionDigits: 2,
-		MaxFractionDigits: 2,
+		NegOffset:    6,
+		FormatWidth:  10,
+		GroupingSize: [2]uint8{3, 0},
+		RoundingContext: RoundingContext{
+			DigitShift:        0,
+			MinIntegerDigits:  1,
+			MinFractionDigits: 2,
+			MaxFractionDigits: 2,
+		},
 	},
 }, {
 	// padding
@@ -321,16 +377,21 @@
 }, {
 	`* #0 o''clock`,
 	&Pattern{Affix: "\x00\x09 o\\'clock",
-		FormatWidth:      10,
-		PadRune:          32,
-		MinIntegerDigits: 0x1},
+		FormatWidth: 10,
+		PadRune:     32,
+		RoundingContext: RoundingContext{
+			MinIntegerDigits: 0x1,
+		},
+	},
 }, {
 	`'123'* #0'456'`,
 	&Pattern{Affix: "\x05'123'\x05'456'",
-		FormatWidth:      8,
-		PadRune:          32,
-		MinIntegerDigits: 0x1,
-		Flags:            PadAfterPrefix},
+		FormatWidth: 8,
+		PadRune:     32,
+		RoundingContext: RoundingContext{
+			MinIntegerDigits: 0x1,
+		},
+		Flags: PadAfterPrefix},
 }, {
 	// no duplicate padding
 	"*xpre#suf*x", nil,
@@ -354,8 +415,8 @@
 }
 
 func TestPatternSize(t *testing.T) {
-	if sz := unsafe.Sizeof(Pattern{}); sz > 48 {
-		t.Errorf("got %d; want <= 48", sz)
+	if sz := unsafe.Sizeof(Pattern{}); sz > 56 {
+		t.Errorf("got %d; want <= 56", sz)
 	}
 
 }
diff --git a/internal/number/tables.go b/internal/number/tables.go
index b08acc4..b140234 100644
--- a/internal/number/tables.go
+++ b/internal/number/tables.go
@@ -847,276 +847,324 @@
 } // Size: 778 bytes
 
 var formats = []Pattern{Pattern{Affix: "",
-	Offset:         0x0,
-	NegOffset:      0x0,
-	FormatWidth:    0x0,
-	RoundIncrement: 0x0,
-	PadRune:        0,
-	DigitShift:     0x0,
+	Offset:      0x0,
+	NegOffset:   0x0,
+	FormatWidth: 0x0,
+	PadRune:     0,
+	RoundingContext: RoundingContext{Mode: 0x0,
+		Precision:            0,
+		Scale:                0,
+		Increment:            0x0,
+		DigitShift:           0x0,
+		MinIntegerDigits:     0x0,
+		MaxIntegerDigits:     0x0,
+		MinFractionDigits:    0x0,
+		MaxFractionDigits:    0x0,
+		MinSignificantDigits: 0x0,
+		MaxSignificantDigits: 0x0,
+		MinExponentDigits:    0x0},
 	GroupingSize: [2]uint8{0x0,
 		0x0},
-	Flags:                0x0,
-	MinIntegerDigits:     0x0,
-	MaxIntegerDigits:     0x0,
-	MinFractionDigits:    0x0,
-	MaxFractionDigits:    0x0,
-	MinSignificantDigits: 0x0,
-	MaxSignificantDigits: 0x0,
-	MinExponentDigits:    0x0},
+	Flags: 0x0},
 	Pattern{Affix: "",
-		Offset:         0x0,
-		NegOffset:      0x0,
-		FormatWidth:    0x9,
-		RoundIncrement: 0x0,
-		PadRune:        0,
-		DigitShift:     0x0,
+		Offset:      0x0,
+		NegOffset:   0x0,
+		FormatWidth: 0x9,
+		PadRune:     0,
+		RoundingContext: RoundingContext{Mode: 0x0,
+			Precision:            0,
+			Scale:                0,
+			Increment:            0x0,
+			DigitShift:           0x0,
+			MinIntegerDigits:     0x1,
+			MaxIntegerDigits:     0x0,
+			MinFractionDigits:    0x0,
+			MaxFractionDigits:    0x3,
+			MinSignificantDigits: 0x0,
+			MaxSignificantDigits: 0x0,
+			MinExponentDigits:    0x0},
 		GroupingSize: [2]uint8{0x3,
 			0x0},
-		Flags:                0x0,
-		MinIntegerDigits:     0x1,
-		MaxIntegerDigits:     0x0,
-		MinFractionDigits:    0x0,
-		MaxFractionDigits:    0x3,
-		MinSignificantDigits: 0x0,
-		MaxSignificantDigits: 0x0,
-		MinExponentDigits:    0x0},
+		Flags: 0x0},
 	Pattern{Affix: "",
-		Offset:         0x0,
-		NegOffset:      0x0,
-		FormatWidth:    0x3,
-		RoundIncrement: 0x0,
-		PadRune:        0,
-		DigitShift:     0x0,
+		Offset:      0x0,
+		NegOffset:   0x0,
+		FormatWidth: 0x3,
+		PadRune:     0,
+		RoundingContext: RoundingContext{Mode: 0x0,
+			Precision:            0,
+			Scale:                0,
+			Increment:            0x0,
+			DigitShift:           0x0,
+			MinIntegerDigits:     0x0,
+			MaxIntegerDigits:     0x1,
+			MinFractionDigits:    0x0,
+			MaxFractionDigits:    0x0,
+			MinSignificantDigits: 0x0,
+			MaxSignificantDigits: 0x0,
+			MinExponentDigits:    0x1},
 		GroupingSize: [2]uint8{0x0,
 			0x0},
-		Flags:                0x0,
-		MinIntegerDigits:     0x0,
-		MaxIntegerDigits:     0x1,
-		MinFractionDigits:    0x0,
-		MaxFractionDigits:    0x0,
-		MinSignificantDigits: 0x0,
-		MaxSignificantDigits: 0x0,
-		MinExponentDigits:    0x1},
+		Flags: 0x0},
 	Pattern{Affix: "\x00\x03\u00a0%",
-		Offset:         0x0,
-		NegOffset:      0x0,
-		FormatWidth:    0x7,
-		RoundIncrement: 0x0,
-		PadRune:        0,
-		DigitShift:     0x2,
+		Offset:      0x0,
+		NegOffset:   0x0,
+		FormatWidth: 0x7,
+		PadRune:     0,
+		RoundingContext: RoundingContext{Mode: 0x0,
+			Precision:            0,
+			Scale:                0,
+			Increment:            0x0,
+			DigitShift:           0x2,
+			MinIntegerDigits:     0x1,
+			MaxIntegerDigits:     0x0,
+			MinFractionDigits:    0x0,
+			MaxFractionDigits:    0x0,
+			MinSignificantDigits: 0x0,
+			MaxSignificantDigits: 0x0,
+			MinExponentDigits:    0x0},
 		GroupingSize: [2]uint8{0x3,
 			0x0},
-		Flags:                0x0,
-		MinIntegerDigits:     0x1,
-		MaxIntegerDigits:     0x0,
-		MinFractionDigits:    0x0,
-		MaxFractionDigits:    0x0,
-		MinSignificantDigits: 0x0,
-		MaxSignificantDigits: 0x0,
-		MinExponentDigits:    0x0},
+		Flags: 0x0},
 	Pattern{Affix: "\x00\x01%",
-		Offset:         0x0,
-		NegOffset:      0x0,
-		FormatWidth:    0x6,
-		RoundIncrement: 0x0,
-		PadRune:        0,
-		DigitShift:     0x2,
+		Offset:      0x0,
+		NegOffset:   0x0,
+		FormatWidth: 0x6,
+		PadRune:     0,
+		RoundingContext: RoundingContext{Mode: 0x0,
+			Precision:            0,
+			Scale:                0,
+			Increment:            0x0,
+			DigitShift:           0x2,
+			MinIntegerDigits:     0x1,
+			MaxIntegerDigits:     0x0,
+			MinFractionDigits:    0x0,
+			MaxFractionDigits:    0x0,
+			MinSignificantDigits: 0x0,
+			MaxSignificantDigits: 0x0,
+			MinExponentDigits:    0x0},
 		GroupingSize: [2]uint8{0x3,
 			0x0},
-		Flags:                0x0,
-		MinIntegerDigits:     0x1,
-		MaxIntegerDigits:     0x0,
-		MinFractionDigits:    0x0,
-		MaxFractionDigits:    0x0,
-		MinSignificantDigits: 0x0,
-		MaxSignificantDigits: 0x0,
-		MinExponentDigits:    0x0},
+		Flags: 0x0},
 	Pattern{Affix: "",
-		Offset:         0x0,
-		NegOffset:      0x0,
-		FormatWidth:    0xc,
-		RoundIncrement: 0x0,
-		PadRune:        0,
-		DigitShift:     0x0,
+		Offset:      0x0,
+		NegOffset:   0x0,
+		FormatWidth: 0xc,
+		PadRune:     0,
+		RoundingContext: RoundingContext{Mode: 0x0,
+			Precision:            0,
+			Scale:                0,
+			Increment:            0x0,
+			DigitShift:           0x0,
+			MinIntegerDigits:     0x1,
+			MaxIntegerDigits:     0x0,
+			MinFractionDigits:    0x0,
+			MaxFractionDigits:    0x3,
+			MinSignificantDigits: 0x0,
+			MaxSignificantDigits: 0x0,
+			MinExponentDigits:    0x0},
 		GroupingSize: [2]uint8{0x3,
 			0x2},
-		Flags:                0x0,
-		MinIntegerDigits:     0x1,
-		MaxIntegerDigits:     0x0,
-		MinFractionDigits:    0x0,
-		MaxFractionDigits:    0x3,
-		MinSignificantDigits: 0x0,
-		MaxSignificantDigits: 0x0,
-		MinExponentDigits:    0x0},
+		Flags: 0x0},
 	Pattern{Affix: "\x00\x01%",
-		Offset:         0x0,
-		NegOffset:      0x0,
-		FormatWidth:    0x9,
-		RoundIncrement: 0x0,
-		PadRune:        0,
-		DigitShift:     0x2,
+		Offset:      0x0,
+		NegOffset:   0x0,
+		FormatWidth: 0x9,
+		PadRune:     0,
+		RoundingContext: RoundingContext{Mode: 0x0,
+			Precision:            0,
+			Scale:                0,
+			Increment:            0x0,
+			DigitShift:           0x2,
+			MinIntegerDigits:     0x1,
+			MaxIntegerDigits:     0x0,
+			MinFractionDigits:    0x0,
+			MaxFractionDigits:    0x0,
+			MinSignificantDigits: 0x0,
+			MaxSignificantDigits: 0x0,
+			MinExponentDigits:    0x0},
 		GroupingSize: [2]uint8{0x3,
 			0x2},
-		Flags:                0x0,
-		MinIntegerDigits:     0x1,
-		MaxIntegerDigits:     0x0,
-		MinFractionDigits:    0x0,
-		MaxFractionDigits:    0x0,
-		MinSignificantDigits: 0x0,
-		MaxSignificantDigits: 0x0,
-		MinExponentDigits:    0x0},
+		Flags: 0x0},
 	Pattern{Affix: "\x00\x03\u00a0%",
-		Offset:         0x0,
-		NegOffset:      0x0,
-		FormatWidth:    0xa,
-		RoundIncrement: 0x0,
-		PadRune:        0,
-		DigitShift:     0x2,
+		Offset:      0x0,
+		NegOffset:   0x0,
+		FormatWidth: 0xa,
+		PadRune:     0,
+		RoundingContext: RoundingContext{Mode: 0x0,
+			Precision:            0,
+			Scale:                0,
+			Increment:            0x0,
+			DigitShift:           0x2,
+			MinIntegerDigits:     0x1,
+			MaxIntegerDigits:     0x0,
+			MinFractionDigits:    0x0,
+			MaxFractionDigits:    0x0,
+			MinSignificantDigits: 0x0,
+			MaxSignificantDigits: 0x0,
+			MinExponentDigits:    0x0},
 		GroupingSize: [2]uint8{0x3,
 			0x2},
-		Flags:                0x0,
-		MinIntegerDigits:     0x1,
-		MaxIntegerDigits:     0x0,
-		MinFractionDigits:    0x0,
-		MaxFractionDigits:    0x0,
-		MinSignificantDigits: 0x0,
-		MaxSignificantDigits: 0x0,
-		MinExponentDigits:    0x0},
+		Flags: 0x0},
 	Pattern{Affix: "",
-		Offset:         0x0,
-		NegOffset:      0x0,
-		FormatWidth:    0x9,
-		RoundIncrement: 0x0,
-		PadRune:        0,
-		DigitShift:     0x0,
+		Offset:      0x0,
+		NegOffset:   0x0,
+		FormatWidth: 0x9,
+		PadRune:     0,
+		RoundingContext: RoundingContext{Mode: 0x0,
+			Precision:            0,
+			Scale:                0,
+			Increment:            0x0,
+			DigitShift:           0x0,
+			MinIntegerDigits:     0x1,
+			MaxIntegerDigits:     0x0,
+			MinFractionDigits:    0x0,
+			MaxFractionDigits:    0x6,
+			MinSignificantDigits: 0x0,
+			MaxSignificantDigits: 0x0,
+			MinExponentDigits:    0x0},
 		GroupingSize: [2]uint8{0x0,
 			0x0},
-		Flags:                0x0,
-		MinIntegerDigits:     0x1,
-		MaxIntegerDigits:     0x0,
-		MinFractionDigits:    0x0,
-		MaxFractionDigits:    0x6,
-		MinSignificantDigits: 0x0,
-		MaxSignificantDigits: 0x0,
-		MinExponentDigits:    0x0},
+		Flags: 0x0},
 	Pattern{Affix: "",
-		Offset:         0x0,
-		NegOffset:      0x0,
-		FormatWidth:    0xd,
-		RoundIncrement: 0x0,
-		PadRune:        0,
-		DigitShift:     0x0,
+		Offset:      0x0,
+		NegOffset:   0x0,
+		FormatWidth: 0xd,
+		PadRune:     0,
+		RoundingContext: RoundingContext{Mode: 0x0,
+			Precision:            0,
+			Scale:                0,
+			Increment:            0x0,
+			DigitShift:           0x0,
+			MinIntegerDigits:     0x1,
+			MaxIntegerDigits:     0x0,
+			MinFractionDigits:    0x6,
+			MaxFractionDigits:    0x6,
+			MinSignificantDigits: 0x0,
+			MaxSignificantDigits: 0x0,
+			MinExponentDigits:    0x3},
 		GroupingSize: [2]uint8{0x0,
 			0x0},
-		Flags:                0x4,
-		MinIntegerDigits:     0x1,
-		MaxIntegerDigits:     0x0,
-		MinFractionDigits:    0x6,
-		MaxFractionDigits:    0x6,
-		MinSignificantDigits: 0x0,
-		MaxSignificantDigits: 0x0,
-		MinExponentDigits:    0x3},
+		Flags: 0x4},
 	Pattern{Affix: "\x00\x01%",
-		Offset:         0x0,
-		NegOffset:      0x0,
-		FormatWidth:    0x3,
-		RoundIncrement: 0x0,
-		PadRune:        0,
-		DigitShift:     0x2,
+		Offset:      0x0,
+		NegOffset:   0x0,
+		FormatWidth: 0x3,
+		PadRune:     0,
+		RoundingContext: RoundingContext{Mode: 0x0,
+			Precision:            0,
+			Scale:                0,
+			Increment:            0x0,
+			DigitShift:           0x2,
+			MinIntegerDigits:     0x1,
+			MaxIntegerDigits:     0x0,
+			MinFractionDigits:    0x0,
+			MaxFractionDigits:    0x0,
+			MinSignificantDigits: 0x0,
+			MaxSignificantDigits: 0x0,
+			MinExponentDigits:    0x0},
 		GroupingSize: [2]uint8{0x0,
 			0x0},
-		Flags:                0x0,
-		MinIntegerDigits:     0x1,
-		MaxIntegerDigits:     0x0,
-		MinFractionDigits:    0x0,
-		MaxFractionDigits:    0x0,
-		MinSignificantDigits: 0x0,
-		MaxSignificantDigits: 0x0,
-		MinExponentDigits:    0x0},
+		Flags: 0x0},
 	Pattern{Affix: "\x03%\u00a0\x00",
-		Offset:         0x0,
-		NegOffset:      0x0,
-		FormatWidth:    0x7,
-		RoundIncrement: 0x0,
-		PadRune:        0,
-		DigitShift:     0x2,
+		Offset:      0x0,
+		NegOffset:   0x0,
+		FormatWidth: 0x7,
+		PadRune:     0,
+		RoundingContext: RoundingContext{Mode: 0x0,
+			Precision:            0,
+			Scale:                0,
+			Increment:            0x0,
+			DigitShift:           0x2,
+			MinIntegerDigits:     0x1,
+			MaxIntegerDigits:     0x0,
+			MinFractionDigits:    0x0,
+			MaxFractionDigits:    0x0,
+			MinSignificantDigits: 0x0,
+			MaxSignificantDigits: 0x0,
+			MinExponentDigits:    0x0},
 		GroupingSize: [2]uint8{0x3,
 			0x0},
-		Flags:                0x0,
-		MinIntegerDigits:     0x1,
-		MaxIntegerDigits:     0x0,
-		MinFractionDigits:    0x0,
-		MaxFractionDigits:    0x0,
-		MinSignificantDigits: 0x0,
-		MaxSignificantDigits: 0x0,
-		MinExponentDigits:    0x0},
+		Flags: 0x0},
 	Pattern{Affix: "\x03%\u00a0\x00\x04%\u00a0-\x00",
-		Offset:         0x0,
-		NegOffset:      0x5,
-		FormatWidth:    0x7,
-		RoundIncrement: 0x0,
-		PadRune:        0,
-		DigitShift:     0x2,
+		Offset:      0x0,
+		NegOffset:   0x5,
+		FormatWidth: 0x7,
+		PadRune:     0,
+		RoundingContext: RoundingContext{Mode: 0x0,
+			Precision:            0,
+			Scale:                0,
+			Increment:            0x0,
+			DigitShift:           0x2,
+			MinIntegerDigits:     0x1,
+			MaxIntegerDigits:     0x0,
+			MinFractionDigits:    0x0,
+			MaxFractionDigits:    0x0,
+			MinSignificantDigits: 0x0,
+			MaxSignificantDigits: 0x0,
+			MinExponentDigits:    0x0},
 		GroupingSize: [2]uint8{0x3,
 			0x0},
-		Flags:                0x0,
-		MinIntegerDigits:     0x1,
-		MaxIntegerDigits:     0x0,
-		MinFractionDigits:    0x0,
-		MaxFractionDigits:    0x0,
-		MinSignificantDigits: 0x0,
-		MaxSignificantDigits: 0x0,
-		MinExponentDigits:    0x0},
+		Flags: 0x0},
 	Pattern{Affix: "\x01[\x01]",
-		Offset:         0x0,
-		NegOffset:      0x0,
-		FormatWidth:    0x5,
-		RoundIncrement: 0x0,
-		PadRune:        0,
-		DigitShift:     0x0,
+		Offset:      0x0,
+		NegOffset:   0x0,
+		FormatWidth: 0x5,
+		PadRune:     0,
+		RoundingContext: RoundingContext{Mode: 0x0,
+			Precision:            0,
+			Scale:                0,
+			Increment:            0x0,
+			DigitShift:           0x0,
+			MinIntegerDigits:     0x0,
+			MaxIntegerDigits:     0x1,
+			MinFractionDigits:    0x0,
+			MaxFractionDigits:    0x0,
+			MinSignificantDigits: 0x0,
+			MaxSignificantDigits: 0x0,
+			MinExponentDigits:    0x1},
 		GroupingSize: [2]uint8{0x0,
 			0x0},
-		Flags:                0x0,
-		MinIntegerDigits:     0x0,
-		MaxIntegerDigits:     0x1,
-		MinFractionDigits:    0x0,
-		MaxFractionDigits:    0x0,
-		MinSignificantDigits: 0x0,
-		MaxSignificantDigits: 0x0,
-		MinExponentDigits:    0x1},
+		Flags: 0x0},
 	Pattern{Affix: "",
-		Offset:         0x0,
-		NegOffset:      0x0,
-		FormatWidth:    0x1,
-		RoundIncrement: 0x0,
-		PadRune:        0,
-		DigitShift:     0x0,
+		Offset:      0x0,
+		NegOffset:   0x0,
+		FormatWidth: 0x1,
+		PadRune:     0,
+		RoundingContext: RoundingContext{Mode: 0x0,
+			Precision:            0,
+			Scale:                0,
+			Increment:            0x0,
+			DigitShift:           0x0,
+			MinIntegerDigits:     0x0,
+			MaxIntegerDigits:     0x0,
+			MinFractionDigits:    0x0,
+			MaxFractionDigits:    0x0,
+			MinSignificantDigits: 0x0,
+			MaxSignificantDigits: 0x0,
+			MinExponentDigits:    0x0},
 		GroupingSize: [2]uint8{0x0,
 			0x0},
-		Flags:                0x0,
-		MinIntegerDigits:     0x0,
-		MaxIntegerDigits:     0x0,
-		MinFractionDigits:    0x0,
-		MaxFractionDigits:    0x0,
-		MinSignificantDigits: 0x0,
-		MaxSignificantDigits: 0x0,
-		MinExponentDigits:    0x0},
+		Flags: 0x0},
 	Pattern{Affix: "\x01%\x00",
-		Offset:         0x0,
-		NegOffset:      0x0,
-		FormatWidth:    0x6,
-		RoundIncrement: 0x0,
-		PadRune:        0,
-		DigitShift:     0x2,
+		Offset:      0x0,
+		NegOffset:   0x0,
+		FormatWidth: 0x6,
+		PadRune:     0,
+		RoundingContext: RoundingContext{Mode: 0x0,
+			Precision:            0,
+			Scale:                0,
+			Increment:            0x0,
+			DigitShift:           0x2,
+			MinIntegerDigits:     0x1,
+			MaxIntegerDigits:     0x0,
+			MinFractionDigits:    0x0,
+			MaxFractionDigits:    0x0,
+			MinSignificantDigits: 0x0,
+			MaxSignificantDigits: 0x0,
+			MinExponentDigits:    0x0},
 		GroupingSize: [2]uint8{0x3,
 			0x0},
-		Flags:                0x0,
-		MinIntegerDigits:     0x1,
-		MaxIntegerDigits:     0x0,
-		MinFractionDigits:    0x0,
-		MaxFractionDigits:    0x0,
-		MinSignificantDigits: 0x0,
-		MaxSignificantDigits: 0x0,
-		MinExponentDigits:    0x0}}
+		Flags: 0x0}}
 
 // Total table size 7101 bytes (6KiB); checksum: 5190D0B3