OSDN Git Service

new repo
[bytom/vapor.git] / vendor / github.com / go-playground / locales / ug_CN / ug_CN.go
1 package ug_CN
2
3 import (
4         "math"
5         "strconv"
6         "time"
7
8         "github.com/go-playground/locales"
9         "github.com/go-playground/locales/currency"
10 )
11
12 type ug_CN struct {
13         locale                 string
14         pluralsCardinal        []locales.PluralRule
15         pluralsOrdinal         []locales.PluralRule
16         pluralsRange           []locales.PluralRule
17         decimal                string
18         group                  string
19         minus                  string
20         percent                string
21         perMille               string
22         timeSeparator          string
23         inifinity              string
24         currencies             []string // idx = enum of currency code
25         currencyNegativePrefix string
26         currencyNegativeSuffix string
27         monthsAbbreviated      []string
28         monthsNarrow           []string
29         monthsWide             []string
30         daysAbbreviated        []string
31         daysNarrow             []string
32         daysShort              []string
33         daysWide               []string
34         periodsAbbreviated     []string
35         periodsNarrow          []string
36         periodsShort           []string
37         periodsWide            []string
38         erasAbbreviated        []string
39         erasNarrow             []string
40         erasWide               []string
41         timezones              map[string]string
42 }
43
44 // New returns a new instance of translator for the 'ug_CN' locale
45 func New() locales.Translator {
46         return &ug_CN{
47                 locale:                 "ug_CN",
48                 pluralsCardinal:        []locales.PluralRule{2, 6},
49                 pluralsOrdinal:         nil,
50                 pluralsRange:           []locales.PluralRule{2, 6},
51                 decimal:                ".",
52                 group:                  ",",
53                 minus:                  "-",
54                 percent:                "%",
55                 perMille:               "‰",
56                 timeSeparator:          ":",
57                 inifinity:              "∞",
58                 currencies:             []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
59                 currencyNegativePrefix: "(",
60                 currencyNegativeSuffix: ")",
61                 monthsAbbreviated:      []string{"", "يانۋار", "فېۋرال", "مارت", "ئاپرېل", "ماي", "ئىيۇن", "ئىيۇل", "ئاۋغۇست", "سېنتەبىر", "ئۆكتەبىر", "نويابىر", "دېكابىر"},
62                 monthsNarrow:           []string{"", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"},
63                 monthsWide:             []string{"", "يانۋار", "فېۋرال", "مارت", "ئاپرېل", "ماي", "ئىيۇن", "ئىيۇل", "ئاۋغۇست", "سېنتەبىر", "ئۆكتەبىر", "نويابىر", "دېكابىر"},
64                 daysAbbreviated:        []string{"يە", "دۈ", "سە", "چا", "پە", "جۈ", "شە"},
65                 daysNarrow:             []string{"ي", "د", "س", "چ", "پ", "ج", "ش"},
66                 daysShort:              []string{"ي", "د", "س", "چ", "پ", "ج", "ش"},
67                 daysWide:               []string{"يەكشەنبە", "دۈشەنبە", "سەيشەنبە", "چارشەنبە", "پەيشەنبە", "جۈمە", "شەنبە"},
68                 periodsAbbreviated:     []string{"چ.ب", "چ.ك"},
69                 periodsNarrow:          []string{"ب", "ك"},
70                 periodsWide:            []string{"چۈشتىن بۇرۇن", "چۈشتىن كېيىن"},
71                 erasAbbreviated:        []string{"BCE", "مىلادىيە"},
72                 erasNarrow:             []string{"BCE", "مىلادىيە"},
73                 erasWide:               []string{"مىلادىيەدىن بۇرۇن", "مىلادىيە"},
74                 timezones:              map[string]string{"COST": "كولومبىيە يازلىق ۋاقتى", "HNT": "نىۋفوئۇنلاند ئۆلچەملىك ۋاقتى", "GMT": "گىرىنۋىچ ۋاقتى", "AEST": "ئاۋسترالىيە شەرقىي قىسىم ئۆلچەملىك ۋاقتى", "HNEG": "شەرقىي گىرېنلاند ئۆلچەملىك ۋاقتى", "SGT": "سىنگاپور ۋاقتى", "CDT": "ئوتتۇرا قىسىم يازلىق ۋاقتى", "AWDT": "ئاۋسترالىيە غەربىي قىسىم يازلىق ۋاقتى", "MEZ": "ئوتتۇرا ياۋروپا ئۆلچەملىك ۋاقتى", "NZDT": "يېڭى زېلاندىيە يازلىق ۋاقتى", "LHDT": "لورد-خاي يازلىق ۋاقتى", "HKST": "شياڭگاڭ يازلىق ۋاقتى", "AKDT": "ئالياسكا يازلىق ۋاقتى", "WESZ": "غەربىي ياۋروپا يازلىق ۋاقتى", "WIB": "غەربىي ھىندونېزىيە ۋاقتى", "HECU": "كۇبا يازلىق ۋاقتى", "AWST": "ئاۋسترالىيە غەربىي قىسىم ئۆلچەملىك ۋاقتى", "LHST": "لورد-خاي ئۆلچەملىك ۋاقتى", "GYT": "گىۋىيانا ۋاقتى", "ChST": "چاموررو ئۆلچەملىك ۋاقتى", "HEPMX": "مېكسىكا تىنچ ئوكيان يازلىق ۋاقتى", "CHADT": "چاتام يازلىق ۋاقتى", "BT": "بۇتان ۋاقتى", "MYT": "مالايشىيا ۋاقتى", "HAT": "نىۋفوئۇنلاند يازلىق ۋاقتى", "WITA": "ئوتتۇرا ھىندونېزىيە ۋاقتى", "AEDT": "ئاۋسترالىيە شەرقىي قىسىم يازلىق ۋاقتى", "MST": "ئاۋمېن ئۆلچەملىك ۋاقتى", "MDT": "ئاۋمېن يازلىق ۋاقتى", "OESZ": "شەرقىي ياۋروپا يازلىق ۋاقتى", "ARST": "ئارگېنتىنا يازلىق ۋاقتى", "GFT": "فىرانسىيەگە قاراشلىق گىۋىيانا ۋاقتى", "HKT": "شياڭگاڭ ئۆلچەملىك ۋاقتى", "PST": "تىنچ ئوكيان ئۆلچەملىك ۋاقتى", "CST": "ئوتتۇرا قىسىم ئۆلچەملىك ۋاقتى", "NZST": "يېڭى زېلاندىيە ئۆلچەملىك ۋاقتى", "HENOMX": "مېكسىكا غەربىي شىمالىي قىسىم يازلىق ۋاقتى", "ACST": "ئاۋسترالىيە ئوتتۇرا قىسىم ئۆلچەملىك ۋاقتى", "HNPM": "ساينىت پىئېر ۋە مىكېلون ئۆلچەملىك ۋاقتى", "WART": "غەربىي ئارگېنتىنا ئۆلچەملىك ۋاقتى", "JST": "ياپونىيە ئۆلچەملىك ۋاقتى", "HEOG": "غەربىي گىرېنلاند يازلىق ۋاقتى", "WAT": "غەربىي ئافرىقا ئۆلچەملىك ۋاقتى", "HEEG": "شەرقىي گىرېنلاند يازلىق ۋاقتى", "EAT": "شەرقىي ئافرىقا ۋاقتى", "PDT": "تىنچ ئوكيان يازلىق ۋاقتى", "WIT": "شەرقىي ھىندونېزىيە ۋاقتى", "OEZ": "شەرقىي ياۋروپا ئۆلچەملىك ۋاقتى", "IST": "ھىندىستان ئۆلچەملىك ۋاقتى", "HNOG": "غەربىي گىرېنلاند ئۆلچەملىك ۋاقتى", "ADT": "ئاتلانتىك ئوكيان يازلىق ۋاقتى", "ECT": "ئېكۋادور ۋاقتى", "CAT": "ئوتتۇرا ئافرىقا ۋاقتى", "ACWDT": "ئاۋسترالىيە ئوتتۇرا غەربىي قىسىم يازلىق ۋاقتى", "TMT": "تۈركمەنىستان ئۆلچەملىك ۋاقتى", "ART": "ئارگېنتىنا ئۆلچەملىك ۋاقتى", "COT": "كولومبىيە ئۆلچەملىك ۋاقتى", "CLT": "چىلى ئۆلچەملىك ۋاقتى", "EST": "شەرقىي قىسىم ئۆلچەملىك ۋاقتى", "BOT": "بولىۋىيە ۋاقتى", "ACWST": "ئاۋستىرالىيە ئوتتۇرا غەربىي قىسىم ئۆلچەملىك ۋاقتى", "WAST": "غەربىي ئافرىقا يازلىق ۋاقتى", "∅∅∅": "ئامازون يازلىق ۋاقتى", "AKST": "ئالياسكا ئۆلچەملىك ۋاقتى", "HNPMX": "مېكسىكا تىنچ ئوكيان ئۆلچەملىك ۋاقتى", "TMST": "تۈركمەنىستان يازلىق ۋاقتى", "JDT": "ياپونىيە يازلىق ۋاقتى", "SAST": "جەنۇبىي ئافرىقا ئۆلچەملىك ۋاقتى", "VET": "ۋېنېزۇئېلا ۋاقتى", "HNNOMX": "مېكسىكا غەربىي شىمالىي قىسىم ئۆلچەملىك ۋاقتى", "CLST": "چىلى يازلىق ۋاقتى", "HEPM": "ساينىت پىئېر ۋە مىكېلون يازلىق ۋاقتى", "HNCU": "كۇبا ئۆلچەملىك ۋاقتى", "UYST": "ئۇرۇگۋاي يازلىق ۋاقتى", "MESZ": "ئوتتۇرا ياۋروپا يازلىق ۋاقتى", "HAST": "ھاۋاي-ئالېيۇت ئۆلچەملىك ۋاقتى", "WARST": "غەربىي ئارگېنتىنا يازلىق ۋاقتى", "ACDT": "ئاۋسترالىيە ئوتتۇرا قىسىم يازلىق ۋاقتى", "WEZ": "غەربىي ياۋروپا ئۆلچەملىك ۋاقتى", "CHAST": "چاتام ئۆلچەملىك ۋاقتى", "SRT": "سۇرىنام ۋاقتى", "UYT": "ئۇرۇگۋاي ئۆلچەملىك ۋاقتى", "HADT": "ھاۋاي-ئالېيۇت يازلىق ۋاقتى", "EDT": "شەرقىي قىسىم يازلىق ۋاقتى", "AST": "ئاتلانتىك ئوكيان ئۆلچەملىك ۋاقتى"},
75         }
76 }
77
78 // Locale returns the current translators string locale
79 func (ug *ug_CN) Locale() string {
80         return ug.locale
81 }
82
83 // PluralsCardinal returns the list of cardinal plural rules associated with 'ug_CN'
84 func (ug *ug_CN) PluralsCardinal() []locales.PluralRule {
85         return ug.pluralsCardinal
86 }
87
88 // PluralsOrdinal returns the list of ordinal plural rules associated with 'ug_CN'
89 func (ug *ug_CN) PluralsOrdinal() []locales.PluralRule {
90         return ug.pluralsOrdinal
91 }
92
93 // PluralsRange returns the list of range plural rules associated with 'ug_CN'
94 func (ug *ug_CN) PluralsRange() []locales.PluralRule {
95         return ug.pluralsRange
96 }
97
98 // CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'ug_CN'
99 func (ug *ug_CN) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
100
101         n := math.Abs(num)
102
103         if n == 1 {
104                 return locales.PluralRuleOne
105         }
106
107         return locales.PluralRuleOther
108 }
109
110 // OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'ug_CN'
111 func (ug *ug_CN) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
112         return locales.PluralRuleUnknown
113 }
114
115 // RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'ug_CN'
116 func (ug *ug_CN) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
117
118         start := ug.CardinalPluralRule(num1, v1)
119         end := ug.CardinalPluralRule(num2, v2)
120
121         if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
122                 return locales.PluralRuleOther
123         } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
124                 return locales.PluralRuleOne
125         }
126
127         return locales.PluralRuleOther
128
129 }
130
131 // MonthAbbreviated returns the locales abbreviated month given the 'month' provided
132 func (ug *ug_CN) MonthAbbreviated(month time.Month) string {
133         return ug.monthsAbbreviated[month]
134 }
135
136 // MonthsAbbreviated returns the locales abbreviated months
137 func (ug *ug_CN) MonthsAbbreviated() []string {
138         return ug.monthsAbbreviated[1:]
139 }
140
141 // MonthNarrow returns the locales narrow month given the 'month' provided
142 func (ug *ug_CN) MonthNarrow(month time.Month) string {
143         return ug.monthsNarrow[month]
144 }
145
146 // MonthsNarrow returns the locales narrow months
147 func (ug *ug_CN) MonthsNarrow() []string {
148         return ug.monthsNarrow[1:]
149 }
150
151 // MonthWide returns the locales wide month given the 'month' provided
152 func (ug *ug_CN) MonthWide(month time.Month) string {
153         return ug.monthsWide[month]
154 }
155
156 // MonthsWide returns the locales wide months
157 func (ug *ug_CN) MonthsWide() []string {
158         return ug.monthsWide[1:]
159 }
160
161 // WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
162 func (ug *ug_CN) WeekdayAbbreviated(weekday time.Weekday) string {
163         return ug.daysAbbreviated[weekday]
164 }
165
166 // WeekdaysAbbreviated returns the locales abbreviated weekdays
167 func (ug *ug_CN) WeekdaysAbbreviated() []string {
168         return ug.daysAbbreviated
169 }
170
171 // WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
172 func (ug *ug_CN) WeekdayNarrow(weekday time.Weekday) string {
173         return ug.daysNarrow[weekday]
174 }
175
176 // WeekdaysNarrow returns the locales narrow weekdays
177 func (ug *ug_CN) WeekdaysNarrow() []string {
178         return ug.daysNarrow
179 }
180
181 // WeekdayShort returns the locales short weekday given the 'weekday' provided
182 func (ug *ug_CN) WeekdayShort(weekday time.Weekday) string {
183         return ug.daysShort[weekday]
184 }
185
186 // WeekdaysShort returns the locales short weekdays
187 func (ug *ug_CN) WeekdaysShort() []string {
188         return ug.daysShort
189 }
190
191 // WeekdayWide returns the locales wide weekday given the 'weekday' provided
192 func (ug *ug_CN) WeekdayWide(weekday time.Weekday) string {
193         return ug.daysWide[weekday]
194 }
195
196 // WeekdaysWide returns the locales wide weekdays
197 func (ug *ug_CN) WeekdaysWide() []string {
198         return ug.daysWide
199 }
200
201 // Decimal returns the decimal point of number
202 func (ug *ug_CN) Decimal() string {
203         return ug.decimal
204 }
205
206 // Group returns the group of number
207 func (ug *ug_CN) Group() string {
208         return ug.group
209 }
210
211 // Group returns the minus sign of number
212 func (ug *ug_CN) Minus() string {
213         return ug.minus
214 }
215
216 // FmtNumber returns 'num' with digits/precision of 'v' for 'ug_CN' and handles both Whole and Real numbers based on 'v'
217 func (ug *ug_CN) FmtNumber(num float64, v uint64) string {
218
219         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
220         l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
221         count := 0
222         inWhole := v == 0
223         b := make([]byte, 0, l)
224
225         for i := len(s) - 1; i >= 0; i-- {
226
227                 if s[i] == '.' {
228                         b = append(b, ug.decimal[0])
229                         inWhole = true
230                         continue
231                 }
232
233                 if inWhole {
234                         if count == 3 {
235                                 b = append(b, ug.group[0])
236                                 count = 1
237                         } else {
238                                 count++
239                         }
240                 }
241
242                 b = append(b, s[i])
243         }
244
245         if num < 0 {
246                 b = append(b, ug.minus[0])
247         }
248
249         // reverse
250         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
251                 b[i], b[j] = b[j], b[i]
252         }
253
254         return string(b)
255 }
256
257 // FmtPercent returns 'num' with digits/precision of 'v' for 'ug_CN' and handles both Whole and Real numbers based on 'v'
258 // NOTE: 'num' passed into FmtPercent is assumed to be in percent already
259 func (ug *ug_CN) FmtPercent(num float64, v uint64) string {
260         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
261         l := len(s) + 3
262         b := make([]byte, 0, l)
263
264         for i := len(s) - 1; i >= 0; i-- {
265
266                 if s[i] == '.' {
267                         b = append(b, ug.decimal[0])
268                         continue
269                 }
270
271                 b = append(b, s[i])
272         }
273
274         if num < 0 {
275                 b = append(b, ug.minus[0])
276         }
277
278         // reverse
279         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
280                 b[i], b[j] = b[j], b[i]
281         }
282
283         b = append(b, ug.percent...)
284
285         return string(b)
286 }
287
288 // FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'ug_CN'
289 func (ug *ug_CN) FmtCurrency(num float64, v uint64, currency currency.Type) string {
290
291         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
292         symbol := ug.currencies[currency]
293         l := len(s) + len(symbol) + 2 + 1*len(s[:len(s)-int(v)-1])/3
294         count := 0
295         inWhole := v == 0
296         b := make([]byte, 0, l)
297
298         for i := len(s) - 1; i >= 0; i-- {
299
300                 if s[i] == '.' {
301                         b = append(b, ug.decimal[0])
302                         inWhole = true
303                         continue
304                 }
305
306                 if inWhole {
307                         if count == 3 {
308                                 b = append(b, ug.group[0])
309                                 count = 1
310                         } else {
311                                 count++
312                         }
313                 }
314
315                 b = append(b, s[i])
316         }
317
318         for j := len(symbol) - 1; j >= 0; j-- {
319                 b = append(b, symbol[j])
320         }
321
322         if num < 0 {
323                 b = append(b, ug.minus[0])
324         }
325
326         // reverse
327         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
328                 b[i], b[j] = b[j], b[i]
329         }
330
331         if int(v) < 2 {
332
333                 if v == 0 {
334                         b = append(b, ug.decimal...)
335                 }
336
337                 for i := 0; i < 2-int(v); i++ {
338                         b = append(b, '0')
339                 }
340         }
341
342         return string(b)
343 }
344
345 // FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'ug_CN'
346 // in accounting notation.
347 func (ug *ug_CN) FmtAccounting(num float64, v uint64, currency currency.Type) string {
348
349         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
350         symbol := ug.currencies[currency]
351         l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
352         count := 0
353         inWhole := v == 0
354         b := make([]byte, 0, l)
355
356         for i := len(s) - 1; i >= 0; i-- {
357
358                 if s[i] == '.' {
359                         b = append(b, ug.decimal[0])
360                         inWhole = true
361                         continue
362                 }
363
364                 if inWhole {
365                         if count == 3 {
366                                 b = append(b, ug.group[0])
367                                 count = 1
368                         } else {
369                                 count++
370                         }
371                 }
372
373                 b = append(b, s[i])
374         }
375
376         if num < 0 {
377
378                 for j := len(symbol) - 1; j >= 0; j-- {
379                         b = append(b, symbol[j])
380                 }
381
382                 b = append(b, ug.currencyNegativePrefix[0])
383
384         } else {
385
386                 for j := len(symbol) - 1; j >= 0; j-- {
387                         b = append(b, symbol[j])
388                 }
389
390         }
391
392         // reverse
393         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
394                 b[i], b[j] = b[j], b[i]
395         }
396
397         if int(v) < 2 {
398
399                 if v == 0 {
400                         b = append(b, ug.decimal...)
401                 }
402
403                 for i := 0; i < 2-int(v); i++ {
404                         b = append(b, '0')
405                 }
406         }
407
408         if num < 0 {
409                 b = append(b, ug.currencyNegativeSuffix...)
410         }
411
412         return string(b)
413 }
414
415 // FmtDateShort returns the short date representation of 't' for 'ug_CN'
416 func (ug *ug_CN) FmtDateShort(t time.Time) string {
417
418         b := make([]byte, 0, 32)
419
420         if t.Year() > 0 {
421                 b = strconv.AppendInt(b, int64(t.Year()), 10)
422         } else {
423                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
424         }
425
426         b = append(b, []byte{0x2d}...)
427
428         if t.Month() < 10 {
429                 b = append(b, '0')
430         }
431
432         b = strconv.AppendInt(b, int64(t.Month()), 10)
433
434         b = append(b, []byte{0x2d}...)
435
436         if t.Day() < 10 {
437                 b = append(b, '0')
438         }
439
440         b = strconv.AppendInt(b, int64(t.Day()), 10)
441
442         return string(b)
443 }
444
445 // FmtDateMedium returns the medium date representation of 't' for 'ug_CN'
446 func (ug *ug_CN) FmtDateMedium(t time.Time) string {
447
448         b := make([]byte, 0, 32)
449
450         b = strconv.AppendInt(b, int64(t.Day()), 10)
451         b = append(b, []byte{0x2d}...)
452         b = append(b, ug.monthsAbbreviated[t.Month()]...)
453         b = append(b, []byte{0xd8, 0x8c, 0x20}...)
454
455         if t.Year() > 0 {
456                 b = strconv.AppendInt(b, int64(t.Year()), 10)
457         } else {
458                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
459         }
460
461         return string(b)
462 }
463
464 // FmtDateLong returns the long date representation of 't' for 'ug_CN'
465 func (ug *ug_CN) FmtDateLong(t time.Time) string {
466
467         b := make([]byte, 0, 32)
468
469         b = strconv.AppendInt(b, int64(t.Day()), 10)
470         b = append(b, []byte{0x2d}...)
471         b = append(b, ug.monthsWide[t.Month()]...)
472         b = append(b, []byte{0xd8, 0x8c, 0x20}...)
473
474         if t.Year() > 0 {
475                 b = strconv.AppendInt(b, int64(t.Year()), 10)
476         } else {
477                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
478         }
479
480         return string(b)
481 }
482
483 // FmtDateFull returns the full date representation of 't' for 'ug_CN'
484 func (ug *ug_CN) FmtDateFull(t time.Time) string {
485
486         b := make([]byte, 0, 32)
487
488         if t.Year() > 0 {
489                 b = strconv.AppendInt(b, int64(t.Year()), 10)
490         } else {
491                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
492         }
493
494         b = append(b, []byte{0x20}...)
495         b = strconv.AppendInt(b, int64(t.Day()), 10)
496         b = append(b, []byte{0x2d}...)
497         b = append(b, ug.monthsWide[t.Month()]...)
498         b = append(b, []byte{0xd8, 0x8c, 0x20}...)
499         b = append(b, ug.daysWide[t.Weekday()]...)
500
501         return string(b)
502 }
503
504 // FmtTimeShort returns the short time representation of 't' for 'ug_CN'
505 func (ug *ug_CN) FmtTimeShort(t time.Time) string {
506
507         b := make([]byte, 0, 32)
508
509         h := t.Hour()
510
511         if h > 12 {
512                 h -= 12
513         }
514
515         b = strconv.AppendInt(b, int64(h), 10)
516         b = append(b, ug.timeSeparator...)
517
518         if t.Minute() < 10 {
519                 b = append(b, '0')
520         }
521
522         b = strconv.AppendInt(b, int64(t.Minute()), 10)
523         b = append(b, []byte{0x20}...)
524
525         if t.Hour() < 12 {
526                 b = append(b, ug.periodsAbbreviated[0]...)
527         } else {
528                 b = append(b, ug.periodsAbbreviated[1]...)
529         }
530
531         return string(b)
532 }
533
534 // FmtTimeMedium returns the medium time representation of 't' for 'ug_CN'
535 func (ug *ug_CN) FmtTimeMedium(t time.Time) string {
536
537         b := make([]byte, 0, 32)
538
539         h := t.Hour()
540
541         if h > 12 {
542                 h -= 12
543         }
544
545         b = strconv.AppendInt(b, int64(h), 10)
546         b = append(b, ug.timeSeparator...)
547
548         if t.Minute() < 10 {
549                 b = append(b, '0')
550         }
551
552         b = strconv.AppendInt(b, int64(t.Minute()), 10)
553         b = append(b, ug.timeSeparator...)
554
555         if t.Second() < 10 {
556                 b = append(b, '0')
557         }
558
559         b = strconv.AppendInt(b, int64(t.Second()), 10)
560         b = append(b, []byte{0x20}...)
561
562         if t.Hour() < 12 {
563                 b = append(b, ug.periodsAbbreviated[0]...)
564         } else {
565                 b = append(b, ug.periodsAbbreviated[1]...)
566         }
567
568         return string(b)
569 }
570
571 // FmtTimeLong returns the long time representation of 't' for 'ug_CN'
572 func (ug *ug_CN) FmtTimeLong(t time.Time) string {
573
574         b := make([]byte, 0, 32)
575
576         h := t.Hour()
577
578         if h > 12 {
579                 h -= 12
580         }
581
582         b = strconv.AppendInt(b, int64(h), 10)
583         b = append(b, ug.timeSeparator...)
584
585         if t.Minute() < 10 {
586                 b = append(b, '0')
587         }
588
589         b = strconv.AppendInt(b, int64(t.Minute()), 10)
590         b = append(b, ug.timeSeparator...)
591
592         if t.Second() < 10 {
593                 b = append(b, '0')
594         }
595
596         b = strconv.AppendInt(b, int64(t.Second()), 10)
597         b = append(b, []byte{0x20}...)
598
599         if t.Hour() < 12 {
600                 b = append(b, ug.periodsAbbreviated[0]...)
601         } else {
602                 b = append(b, ug.periodsAbbreviated[1]...)
603         }
604
605         b = append(b, []byte{0x20}...)
606
607         tz, _ := t.Zone()
608         b = append(b, tz...)
609
610         return string(b)
611 }
612
613 // FmtTimeFull returns the full time representation of 't' for 'ug_CN'
614 func (ug *ug_CN) FmtTimeFull(t time.Time) string {
615
616         b := make([]byte, 0, 32)
617
618         h := t.Hour()
619
620         if h > 12 {
621                 h -= 12
622         }
623
624         b = strconv.AppendInt(b, int64(h), 10)
625         b = append(b, ug.timeSeparator...)
626
627         if t.Minute() < 10 {
628                 b = append(b, '0')
629         }
630
631         b = strconv.AppendInt(b, int64(t.Minute()), 10)
632         b = append(b, ug.timeSeparator...)
633
634         if t.Second() < 10 {
635                 b = append(b, '0')
636         }
637
638         b = strconv.AppendInt(b, int64(t.Second()), 10)
639         b = append(b, []byte{0x20}...)
640
641         if t.Hour() < 12 {
642                 b = append(b, ug.periodsAbbreviated[0]...)
643         } else {
644                 b = append(b, ug.periodsAbbreviated[1]...)
645         }
646
647         b = append(b, []byte{0x20}...)
648
649         tz, _ := t.Zone()
650
651         if btz, ok := ug.timezones[tz]; ok {
652                 b = append(b, btz...)
653         } else {
654                 b = append(b, tz...)
655         }
656
657         return string(b)
658 }