OSDN Git Service

delete miner
[bytom/vapor.git] / vendor / github.com / go-playground / locales / ar_KM / ar_KM.go
1 package ar_KM
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 ar_KM 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         percentSuffix          string
22         perMille               string
23         timeSeparator          string
24         inifinity              string
25         currencies             []string // idx = enum of currency code
26         currencyPositiveSuffix string
27         currencyNegativeSuffix string
28         monthsAbbreviated      []string
29         monthsNarrow           []string
30         monthsWide             []string
31         daysAbbreviated        []string
32         daysNarrow             []string
33         daysShort              []string
34         daysWide               []string
35         periodsAbbreviated     []string
36         periodsNarrow          []string
37         periodsShort           []string
38         periodsWide            []string
39         erasAbbreviated        []string
40         erasNarrow             []string
41         erasWide               []string
42         timezones              map[string]string
43 }
44
45 // New returns a new instance of translator for the 'ar_KM' locale
46 func New() locales.Translator {
47         return &ar_KM{
48                 locale:                 "ar_KM",
49                 pluralsCardinal:        []locales.PluralRule{1, 2, 3, 4, 5, 6},
50                 pluralsOrdinal:         []locales.PluralRule{6},
51                 pluralsRange:           []locales.PluralRule{1, 4, 5, 6},
52                 decimal:                "٫",
53                 group:                  "٬",
54                 minus:                  "؜-",
55                 percent:                "٪؜",
56                 perMille:               "؉",
57                 timeSeparator:          ":",
58                 inifinity:              "∞",
59                 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"},
60                 percentSuffix:          " ",
61                 currencyPositiveSuffix: " ",
62                 currencyNegativeSuffix: " ",
63                 monthsAbbreviated:      []string{"", "يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"},
64                 monthsNarrow:           []string{"", "ي", "ف", "م", "أ", "و", "ن", "ل", "غ", "س", "ك", "ب", "د"},
65                 monthsWide:             []string{"", "يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"},
66                 daysAbbreviated:        []string{"الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"},
67                 daysNarrow:             []string{"ح", "ن", "ث", "ر", "خ", "ج", "س"},
68                 daysShort:              []string{"الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"},
69                 daysWide:               []string{"الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"},
70                 periodsAbbreviated:     []string{"ص", "م"},
71                 periodsNarrow:          []string{"ص", "م"},
72                 periodsWide:            []string{"ص", "م"},
73                 erasAbbreviated:        []string{"", ""},
74                 erasNarrow:             []string{"", ""},
75                 erasWide:               []string{"", ""},
76                 timezones:              map[string]string{"WAST": "توقيت غرب أفريقيا الصيفي", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "GMT": "توقيت غرينتش", "LHST": "توقيت لورد هاو الرسمي", "WITA": "توقيت وسط إندونيسيا", "IST": "توقيت الهند", "HKST": "توقيت هونغ كونغ الصيفي", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "NZDT": "توقيت نيوزيلندا الصيفي", "OEZ": "توقيت شرق أوروبا الرسمي", "HEPM": "توقيت سانت بيير وميكولون الصيفي", "MEZ": "توقيت وسط أوروبا الرسمي", "MDT": "التوقيت الجبلي الصيفي لأمريكا الشمالية", "CHAST": "توقيت تشاتام الرسمي", "BOT": "توقيت بوليفيا", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "VET": "توقيت فنزويلا", "HAST": "توقيت هاواي ألوتيان الرسمي", "COST": "توقيت كولومبيا الصيفي", "GFT": "توقيت غايانا الفرنسية", "PST": "توقيت المحيط الهادي الرسمي", "MYT": "توقيت ماليزيا", "HKT": "توقيت هونغ كونغ الرسمي", "HECU": "توقيت كوبا الصيفي", "EAT": "توقيت شرق أفريقيا", "HNOG": "توقيت غرب غرينلاند الرسمي", "AEDT": "توقيت شرق أستراليا الصيفي", "ARST": "توقيت الأرجنتين الصيفي", "HNEG": "توقيت شرق غرينلاند الرسمي", "HAT": "توقيت نيوفاوندلاند الصيفي", "ACDT": "توقيت وسط أستراليا الصيفي", "AWDT": "توقيت غرب أستراليا الصيفي", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "ChST": "توقيت تشامورو", "HEPMX": "توقيت المحيط الهادي الصيفي للمكسيك", "MESZ": "توقيت وسط أوروبا الصيفي", "LHDT": "التوقيت الصيفي للورد هاو", "ART": "توقيت الأرجنتين الرسمي", "CLST": "توقيت شيلي الصيفي", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "AKDT": "توقيت ألاسكا الصيفي", "CAT": "توقيت وسط أفريقيا", "WEZ": "توقيت غرب أوروبا الرسمي", "HNNOMX": "التوقيت الرسمي لشمال غرب المكسيك", "BT": "توقيت بوتان", "HNCU": "توقيت كوبا الرسمي", "AEST": "توقيت شرق أستراليا الرسمي", "HNPM": "توقيت سانت بيير وميكولون الرسمي", "AWST": "توقيت غرب أستراليا الرسمي", "HADT": "توقيت هاواي ألوتيان الصيفي", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "NZST": "توقيت نيوزيلندا الرسمي", "OESZ": "توقيت شرق أوروبا الصيفي", "∅∅∅": "توقيت أزورس الصيفي", "GYT": "توقيت غيانا", "SGT": "توقيت سنغافورة", "SRT": "توقيت سورينام", "WIT": "توقيت شرق إندونيسيا", "HEEG": "توقيت شرق غرينلاند الصيفي", "ACST": "توقيت وسط أستراليا الرسمي", "WESZ": "توقيت غرب أوروبا الصيفي", "HENOMX": "التوقيت الصيفي لشمال غرب المكسيك", "UYST": "توقيت أورغواي الصيفي", "TMT": "توقيت تركمانستان الرسمي", "JST": "توقيت اليابان الرسمي", "AST": "التوقيت الرسمي الأطلسي", "CLT": "توقيت شيلي الرسمي", "UYT": "توقيت أورغواي الرسمي", "JDT": "توقيت اليابان الصيفي", "HEOG": "توقيت غرب غرينلاند الصيفي", "ADT": "التوقيت الصيفي الأطلسي", "WAT": "توقيت غرب أفريقيا الرسمي", "HNT": "توقيت نيوفاوندلاند الرسمي", "ECT": "توقيت الإكوادور", "WIB": "توقيت غرب إندونيسيا", "WARST": "توقيت غرب الأرجنتين الصيفي", "PDT": "توقيت المحيط الهادي الصيفي", "WART": "توقيت غرب الأرجنتين الرسمي", "MST": "التوقيت الجبلي الرسمي لأمريكا الشمالية", "SAST": "توقيت جنوب أفريقيا", "COT": "توقيت كولومبيا الرسمي", "AKST": "التوقيت الرسمي لألاسكا", "HNPMX": "توقيت المحيط الهادي الرسمي للمكسيك", "CHADT": "توقيت تشاتام الصيفي", "TMST": "توقيت تركمانستان الصيفي"},
77         }
78 }
79
80 // Locale returns the current translators string locale
81 func (ar *ar_KM) Locale() string {
82         return ar.locale
83 }
84
85 // PluralsCardinal returns the list of cardinal plural rules associated with 'ar_KM'
86 func (ar *ar_KM) PluralsCardinal() []locales.PluralRule {
87         return ar.pluralsCardinal
88 }
89
90 // PluralsOrdinal returns the list of ordinal plural rules associated with 'ar_KM'
91 func (ar *ar_KM) PluralsOrdinal() []locales.PluralRule {
92         return ar.pluralsOrdinal
93 }
94
95 // PluralsRange returns the list of range plural rules associated with 'ar_KM'
96 func (ar *ar_KM) PluralsRange() []locales.PluralRule {
97         return ar.pluralsRange
98 }
99
100 // CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'ar_KM'
101 func (ar *ar_KM) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
102
103         n := math.Abs(num)
104         nMod100 := math.Mod(n, 100)
105
106         if n == 0 {
107                 return locales.PluralRuleZero
108         } else if n == 1 {
109                 return locales.PluralRuleOne
110         } else if n == 2 {
111                 return locales.PluralRuleTwo
112         } else if nMod100 >= 3 && nMod100 <= 10 {
113                 return locales.PluralRuleFew
114         } else if nMod100 >= 11 && nMod100 <= 99 {
115                 return locales.PluralRuleMany
116         }
117
118         return locales.PluralRuleOther
119 }
120
121 // OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'ar_KM'
122 func (ar *ar_KM) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
123         return locales.PluralRuleOther
124 }
125
126 // RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'ar_KM'
127 func (ar *ar_KM) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
128
129         start := ar.CardinalPluralRule(num1, v1)
130         end := ar.CardinalPluralRule(num2, v2)
131
132         if start == locales.PluralRuleZero && end == locales.PluralRuleOne {
133                 return locales.PluralRuleZero
134         } else if start == locales.PluralRuleZero && end == locales.PluralRuleTwo {
135                 return locales.PluralRuleZero
136         } else if start == locales.PluralRuleZero && end == locales.PluralRuleFew {
137                 return locales.PluralRuleFew
138         } else if start == locales.PluralRuleZero && end == locales.PluralRuleMany {
139                 return locales.PluralRuleMany
140         } else if start == locales.PluralRuleZero && end == locales.PluralRuleOther {
141                 return locales.PluralRuleOther
142         } else if start == locales.PluralRuleOne && end == locales.PluralRuleTwo {
143                 return locales.PluralRuleOther
144         } else if start == locales.PluralRuleOne && end == locales.PluralRuleFew {
145                 return locales.PluralRuleFew
146         } else if start == locales.PluralRuleOne && end == locales.PluralRuleMany {
147                 return locales.PluralRuleMany
148         } else if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
149                 return locales.PluralRuleOther
150         } else if start == locales.PluralRuleTwo && end == locales.PluralRuleFew {
151                 return locales.PluralRuleFew
152         } else if start == locales.PluralRuleTwo && end == locales.PluralRuleMany {
153                 return locales.PluralRuleMany
154         } else if start == locales.PluralRuleTwo && end == locales.PluralRuleOther {
155                 return locales.PluralRuleOther
156         } else if start == locales.PluralRuleFew && end == locales.PluralRuleFew {
157                 return locales.PluralRuleFew
158         } else if start == locales.PluralRuleFew && end == locales.PluralRuleMany {
159                 return locales.PluralRuleMany
160         } else if start == locales.PluralRuleFew && end == locales.PluralRuleOther {
161                 return locales.PluralRuleOther
162         } else if start == locales.PluralRuleMany && end == locales.PluralRuleFew {
163                 return locales.PluralRuleFew
164         } else if start == locales.PluralRuleMany && end == locales.PluralRuleMany {
165                 return locales.PluralRuleMany
166         } else if start == locales.PluralRuleMany && end == locales.PluralRuleOther {
167                 return locales.PluralRuleOther
168         } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
169                 return locales.PluralRuleOther
170         } else if start == locales.PluralRuleOther && end == locales.PluralRuleTwo {
171                 return locales.PluralRuleOther
172         } else if start == locales.PluralRuleOther && end == locales.PluralRuleFew {
173                 return locales.PluralRuleFew
174         } else if start == locales.PluralRuleOther && end == locales.PluralRuleMany {
175                 return locales.PluralRuleMany
176         }
177
178         return locales.PluralRuleOther
179
180 }
181
182 // MonthAbbreviated returns the locales abbreviated month given the 'month' provided
183 func (ar *ar_KM) MonthAbbreviated(month time.Month) string {
184         return ar.monthsAbbreviated[month]
185 }
186
187 // MonthsAbbreviated returns the locales abbreviated months
188 func (ar *ar_KM) MonthsAbbreviated() []string {
189         return ar.monthsAbbreviated[1:]
190 }
191
192 // MonthNarrow returns the locales narrow month given the 'month' provided
193 func (ar *ar_KM) MonthNarrow(month time.Month) string {
194         return ar.monthsNarrow[month]
195 }
196
197 // MonthsNarrow returns the locales narrow months
198 func (ar *ar_KM) MonthsNarrow() []string {
199         return ar.monthsNarrow[1:]
200 }
201
202 // MonthWide returns the locales wide month given the 'month' provided
203 func (ar *ar_KM) MonthWide(month time.Month) string {
204         return ar.monthsWide[month]
205 }
206
207 // MonthsWide returns the locales wide months
208 func (ar *ar_KM) MonthsWide() []string {
209         return ar.monthsWide[1:]
210 }
211
212 // WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
213 func (ar *ar_KM) WeekdayAbbreviated(weekday time.Weekday) string {
214         return ar.daysAbbreviated[weekday]
215 }
216
217 // WeekdaysAbbreviated returns the locales abbreviated weekdays
218 func (ar *ar_KM) WeekdaysAbbreviated() []string {
219         return ar.daysAbbreviated
220 }
221
222 // WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
223 func (ar *ar_KM) WeekdayNarrow(weekday time.Weekday) string {
224         return ar.daysNarrow[weekday]
225 }
226
227 // WeekdaysNarrow returns the locales narrow weekdays
228 func (ar *ar_KM) WeekdaysNarrow() []string {
229         return ar.daysNarrow
230 }
231
232 // WeekdayShort returns the locales short weekday given the 'weekday' provided
233 func (ar *ar_KM) WeekdayShort(weekday time.Weekday) string {
234         return ar.daysShort[weekday]
235 }
236
237 // WeekdaysShort returns the locales short weekdays
238 func (ar *ar_KM) WeekdaysShort() []string {
239         return ar.daysShort
240 }
241
242 // WeekdayWide returns the locales wide weekday given the 'weekday' provided
243 func (ar *ar_KM) WeekdayWide(weekday time.Weekday) string {
244         return ar.daysWide[weekday]
245 }
246
247 // WeekdaysWide returns the locales wide weekdays
248 func (ar *ar_KM) WeekdaysWide() []string {
249         return ar.daysWide
250 }
251
252 // Decimal returns the decimal point of number
253 func (ar *ar_KM) Decimal() string {
254         return ar.decimal
255 }
256
257 // Group returns the group of number
258 func (ar *ar_KM) Group() string {
259         return ar.group
260 }
261
262 // Group returns the minus sign of number
263 func (ar *ar_KM) Minus() string {
264         return ar.minus
265 }
266
267 // FmtNumber returns 'num' with digits/precision of 'v' for 'ar_KM' and handles both Whole and Real numbers based on 'v'
268 func (ar *ar_KM) FmtNumber(num float64, v uint64) string {
269
270         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
271         l := len(s) + 5 + 2*len(s[:len(s)-int(v)-1])/3
272         count := 0
273         inWhole := v == 0
274         b := make([]byte, 0, l)
275
276         for i := len(s) - 1; i >= 0; i-- {
277
278                 if s[i] == '.' {
279                         for j := len(ar.decimal) - 1; j >= 0; j-- {
280                                 b = append(b, ar.decimal[j])
281                         }
282                         inWhole = true
283                         continue
284                 }
285
286                 if inWhole {
287                         if count == 3 {
288                                 for j := len(ar.group) - 1; j >= 0; j-- {
289                                         b = append(b, ar.group[j])
290                                 }
291                                 count = 1
292                         } else {
293                                 count++
294                         }
295                 }
296
297                 b = append(b, s[i])
298         }
299
300         if num < 0 {
301                 for j := len(ar.minus) - 1; j >= 0; j-- {
302                         b = append(b, ar.minus[j])
303                 }
304         }
305
306         // reverse
307         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
308                 b[i], b[j] = b[j], b[i]
309         }
310
311         return string(b)
312 }
313
314 // FmtPercent returns 'num' with digits/precision of 'v' for 'ar_KM' and handles both Whole and Real numbers based on 'v'
315 // NOTE: 'num' passed into FmtPercent is assumed to be in percent already
316 func (ar *ar_KM) FmtPercent(num float64, v uint64) string {
317         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
318         l := len(s) + 11
319         b := make([]byte, 0, l)
320
321         for i := len(s) - 1; i >= 0; i-- {
322
323                 if s[i] == '.' {
324                         for j := len(ar.decimal) - 1; j >= 0; j-- {
325                                 b = append(b, ar.decimal[j])
326                         }
327                         continue
328                 }
329
330                 b = append(b, s[i])
331         }
332
333         if num < 0 {
334                 for j := len(ar.minus) - 1; j >= 0; j-- {
335                         b = append(b, ar.minus[j])
336                 }
337         }
338
339         // reverse
340         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
341                 b[i], b[j] = b[j], b[i]
342         }
343
344         b = append(b, ar.percentSuffix...)
345
346         b = append(b, ar.percent...)
347
348         return string(b)
349 }
350
351 // FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'ar_KM'
352 func (ar *ar_KM) FmtCurrency(num float64, v uint64, currency currency.Type) string {
353
354         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
355         symbol := ar.currencies[currency]
356         l := len(s) + len(symbol) + 7 + 2*len(s[:len(s)-int(v)-1])/3
357         count := 0
358         inWhole := v == 0
359         b := make([]byte, 0, l)
360
361         for i := len(s) - 1; i >= 0; i-- {
362
363                 if s[i] == '.' {
364                         for j := len(ar.decimal) - 1; j >= 0; j-- {
365                                 b = append(b, ar.decimal[j])
366                         }
367                         inWhole = true
368                         continue
369                 }
370
371                 if inWhole {
372                         if count == 3 {
373                                 for j := len(ar.group) - 1; j >= 0; j-- {
374                                         b = append(b, ar.group[j])
375                                 }
376                                 count = 1
377                         } else {
378                                 count++
379                         }
380                 }
381
382                 b = append(b, s[i])
383         }
384
385         if num < 0 {
386                 for j := len(ar.minus) - 1; j >= 0; j-- {
387                         b = append(b, ar.minus[j])
388                 }
389         }
390
391         // reverse
392         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
393                 b[i], b[j] = b[j], b[i]
394         }
395
396         if int(v) < 2 {
397
398                 if v == 0 {
399                         b = append(b, ar.decimal...)
400                 }
401
402                 for i := 0; i < 2-int(v); i++ {
403                         b = append(b, '0')
404                 }
405         }
406
407         b = append(b, ar.currencyPositiveSuffix...)
408
409         b = append(b, symbol...)
410
411         return string(b)
412 }
413
414 // FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'ar_KM'
415 // in accounting notation.
416 func (ar *ar_KM) FmtAccounting(num float64, v uint64, currency currency.Type) string {
417
418         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
419         symbol := ar.currencies[currency]
420         l := len(s) + len(symbol) + 7 + 2*len(s[:len(s)-int(v)-1])/3
421         count := 0
422         inWhole := v == 0
423         b := make([]byte, 0, l)
424
425         for i := len(s) - 1; i >= 0; i-- {
426
427                 if s[i] == '.' {
428                         for j := len(ar.decimal) - 1; j >= 0; j-- {
429                                 b = append(b, ar.decimal[j])
430                         }
431                         inWhole = true
432                         continue
433                 }
434
435                 if inWhole {
436                         if count == 3 {
437                                 for j := len(ar.group) - 1; j >= 0; j-- {
438                                         b = append(b, ar.group[j])
439                                 }
440                                 count = 1
441                         } else {
442                                 count++
443                         }
444                 }
445
446                 b = append(b, s[i])
447         }
448
449         if num < 0 {
450
451                 for j := len(ar.minus) - 1; j >= 0; j-- {
452                         b = append(b, ar.minus[j])
453                 }
454
455         }
456
457         // reverse
458         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
459                 b[i], b[j] = b[j], b[i]
460         }
461
462         if int(v) < 2 {
463
464                 if v == 0 {
465                         b = append(b, ar.decimal...)
466                 }
467
468                 for i := 0; i < 2-int(v); i++ {
469                         b = append(b, '0')
470                 }
471         }
472
473         if num < 0 {
474                 b = append(b, ar.currencyNegativeSuffix...)
475                 b = append(b, symbol...)
476         } else {
477
478                 b = append(b, ar.currencyPositiveSuffix...)
479                 b = append(b, symbol...)
480         }
481
482         return string(b)
483 }
484
485 // FmtDateShort returns the short date representation of 't' for 'ar_KM'
486 func (ar *ar_KM) FmtDateShort(t time.Time) string {
487
488         b := make([]byte, 0, 32)
489
490         b = strconv.AppendInt(b, int64(t.Day()), 10)
491         b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
492         b = strconv.AppendInt(b, int64(t.Month()), 10)
493         b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
494
495         if t.Year() > 0 {
496                 b = strconv.AppendInt(b, int64(t.Year()), 10)
497         } else {
498                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
499         }
500
501         return string(b)
502 }
503
504 // FmtDateMedium returns the medium date representation of 't' for 'ar_KM'
505 func (ar *ar_KM) FmtDateMedium(t time.Time) string {
506
507         b := make([]byte, 0, 32)
508
509         if t.Day() < 10 {
510                 b = append(b, '0')
511         }
512
513         b = strconv.AppendInt(b, int64(t.Day()), 10)
514         b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
515
516         if t.Month() < 10 {
517                 b = append(b, '0')
518         }
519
520         b = strconv.AppendInt(b, int64(t.Month()), 10)
521
522         b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
523
524         if t.Year() > 0 {
525                 b = strconv.AppendInt(b, int64(t.Year()), 10)
526         } else {
527                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
528         }
529
530         return string(b)
531 }
532
533 // FmtDateLong returns the long date representation of 't' for 'ar_KM'
534 func (ar *ar_KM) FmtDateLong(t time.Time) string {
535
536         b := make([]byte, 0, 32)
537
538         b = strconv.AppendInt(b, int64(t.Day()), 10)
539         b = append(b, []byte{0x20}...)
540         b = append(b, ar.monthsWide[t.Month()]...)
541         b = append(b, []byte{0xd8, 0x8c, 0x20}...)
542
543         if t.Year() > 0 {
544                 b = strconv.AppendInt(b, int64(t.Year()), 10)
545         } else {
546                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
547         }
548
549         return string(b)
550 }
551
552 // FmtDateFull returns the full date representation of 't' for 'ar_KM'
553 func (ar *ar_KM) FmtDateFull(t time.Time) string {
554
555         b := make([]byte, 0, 32)
556
557         b = append(b, ar.daysWide[t.Weekday()]...)
558         b = append(b, []byte{0xd8, 0x8c, 0x20}...)
559         b = strconv.AppendInt(b, int64(t.Day()), 10)
560         b = append(b, []byte{0x20}...)
561         b = append(b, ar.monthsWide[t.Month()]...)
562         b = append(b, []byte{0xd8, 0x8c, 0x20}...)
563
564         if t.Year() > 0 {
565                 b = strconv.AppendInt(b, int64(t.Year()), 10)
566         } else {
567                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
568         }
569
570         return string(b)
571 }
572
573 // FmtTimeShort returns the short time representation of 't' for 'ar_KM'
574 func (ar *ar_KM) FmtTimeShort(t time.Time) string {
575
576         b := make([]byte, 0, 32)
577
578         if t.Hour() < 10 {
579                 b = append(b, '0')
580         }
581
582         b = strconv.AppendInt(b, int64(t.Hour()), 10)
583         b = append(b, ar.timeSeparator...)
584
585         if t.Minute() < 10 {
586                 b = append(b, '0')
587         }
588
589         b = strconv.AppendInt(b, int64(t.Minute()), 10)
590
591         return string(b)
592 }
593
594 // FmtTimeMedium returns the medium time representation of 't' for 'ar_KM'
595 func (ar *ar_KM) FmtTimeMedium(t time.Time) string {
596
597         b := make([]byte, 0, 32)
598
599         if t.Hour() < 10 {
600                 b = append(b, '0')
601         }
602
603         b = strconv.AppendInt(b, int64(t.Hour()), 10)
604         b = append(b, ar.timeSeparator...)
605
606         if t.Minute() < 10 {
607                 b = append(b, '0')
608         }
609
610         b = strconv.AppendInt(b, int64(t.Minute()), 10)
611         b = append(b, ar.timeSeparator...)
612
613         if t.Second() < 10 {
614                 b = append(b, '0')
615         }
616
617         b = strconv.AppendInt(b, int64(t.Second()), 10)
618
619         return string(b)
620 }
621
622 // FmtTimeLong returns the long time representation of 't' for 'ar_KM'
623 func (ar *ar_KM) FmtTimeLong(t time.Time) string {
624
625         b := make([]byte, 0, 32)
626
627         if t.Hour() < 10 {
628                 b = append(b, '0')
629         }
630
631         b = strconv.AppendInt(b, int64(t.Hour()), 10)
632         b = append(b, ar.timeSeparator...)
633
634         if t.Minute() < 10 {
635                 b = append(b, '0')
636         }
637
638         b = strconv.AppendInt(b, int64(t.Minute()), 10)
639         b = append(b, ar.timeSeparator...)
640
641         if t.Second() < 10 {
642                 b = append(b, '0')
643         }
644
645         b = strconv.AppendInt(b, int64(t.Second()), 10)
646         b = append(b, []byte{0x20}...)
647
648         tz, _ := t.Zone()
649         b = append(b, tz...)
650
651         return string(b)
652 }
653
654 // FmtTimeFull returns the full time representation of 't' for 'ar_KM'
655 func (ar *ar_KM) FmtTimeFull(t time.Time) string {
656
657         b := make([]byte, 0, 32)
658
659         if t.Hour() < 10 {
660                 b = append(b, '0')
661         }
662
663         b = strconv.AppendInt(b, int64(t.Hour()), 10)
664         b = append(b, ar.timeSeparator...)
665
666         if t.Minute() < 10 {
667                 b = append(b, '0')
668         }
669
670         b = strconv.AppendInt(b, int64(t.Minute()), 10)
671         b = append(b, ar.timeSeparator...)
672
673         if t.Second() < 10 {
674                 b = append(b, '0')
675         }
676
677         b = strconv.AppendInt(b, int64(t.Second()), 10)
678         b = append(b, []byte{0x20}...)
679
680         tz, _ := t.Zone()
681
682         if btz, ok := ar.timezones[tz]; ok {
683                 b = append(b, btz...)
684         } else {
685                 b = append(b, tz...)
686         }
687
688         return string(b)
689 }