1package ar_YE 2 3import ( 4 "math" 5 "strconv" 6 "time" 7 8 "github.com/go-playground/locales" 9 "github.com/go-playground/locales/currency" 10) 11 12type ar_YE 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_YE' locale 46func New() locales.Translator { 47 return &ar_YE{ 48 locale: "ar_YE", 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", "CNH", "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", "STN", "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{"HNCU": "توقيت كوبا الرسمي", "AKST": "التوقيت الرسمي لألاسكا", "WARST": "توقيت غرب الأرجنتين الصيفي", "IST": "توقيت الهند", "HNT": "توقيت نيوفاوندلاند الرسمي", "OESZ": "توقيت شرق أوروبا الصيفي", "ChST": "توقيت تشامورو", "HEPMX": "توقيت المحيط الهادي الصيفي للمكسيك", "WAST": "توقيت غرب أفريقيا الصيفي", "ACDT": "توقيت وسط أستراليا الصيفي", "WITA": "توقيت وسط إندونيسيا", "TMST": "توقيت تركمانستان الصيفي", "COT": "توقيت كولومبيا الرسمي", "HKT": "توقيت هونغ كونغ الرسمي", "HAT": "توقيت نيوفاوندلاند الصيفي", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "PDT": "توقيت المحيط الهادي الصيفي", "WAT": "توقيت غرب أفريقيا الرسمي", "JST": "توقيت اليابان الرسمي", "HNOG": "توقيت غرب غرينلاند الرسمي", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "VET": "توقيت فنزويلا", "WIT": "توقيت شرق إندونيسيا", "MST": "التوقيت الجبلي الرسمي لأمريكا الشمالية", "SRT": "توقيت سورينام", "ART": "توقيت الأرجنتين الرسمي", "HAST": "توقيت هاواي ألوتيان الرسمي", "CHAST": "توقيت تشاتام الرسمي", "GYT": "توقيت غيانا", "HEEG": "توقيت شرق غرينلاند الصيفي", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "MEZ": "توقيت وسط أوروبا الرسمي", "MESZ": "توقيت وسط أوروبا الصيفي", "UYST": "توقيت أوروغواي الصيفي", "GMT": "توقيت غرينتش", "MYT": "توقيت ماليزيا", "NZST": "توقيت نيوزيلندا الرسمي", "CLT": "توقيت شيلي الرسمي", "CAT": "توقيت وسط أفريقيا", "WIB": "توقيت غرب إندونيسيا", "BOT": "توقيت بوليفيا", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "LHDT": "التوقيت الصيفي للورد هاو", "HNPMX": "توقيت المحيط الهادي الرسمي للمكسيك", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "MDT": "التوقيت الجبلي الصيفي لأمريكا الشمالية", "NZDT": "توقيت نيوزيلندا الصيفي", "TMT": "توقيت تركمانستان الرسمي", "SGT": "توقيت سنغافورة", "HEPM": "توقيت سانت بيير وميكولون الصيفي", "HNPM": "توقيت سانت بيير وميكولون الرسمي", "EAT": "توقيت شرق أفريقيا", "AWST": "توقيت غرب أستراليا الرسمي", "AEST": "توقيت شرق أستراليا الرسمي", "SAST": "توقيت جنوب أفريقيا", "HKST": "توقيت هونغ كونغ الصيفي", "WART": "توقيت غرب الأرجنتين الرسمي", "LHST": "توقيت لورد هاو الرسمي", "HADT": "توقيت هاواي ألوتيان الصيفي", "AWDT": "توقيت غرب أستراليا الصيفي", "PST": "توقيت المحيط الهادي الرسمي", "WEZ": "توقيت غرب أوروبا الرسمي", "WESZ": "توقيت غرب أوروبا الصيفي", "∅∅∅": "∅∅∅", "HNEG": "توقيت شرق غرينلاند الرسمي", "AEDT": "توقيت شرق أستراليا الصيفي", "ECT": "توقيت الإكوادور", "HEOG": "توقيت غرب غرينلاند الصيفي", "HNNOMX": "التوقيت الرسمي لشمال غرب المكسيك", "GFT": "توقيت غايانا الفرنسية", "HENOMX": "التوقيت الصيفي لشمال غرب المكسيك", "CHADT": "توقيت تشاتام الصيفي", "AST": "التوقيت الرسمي الأطلسي", "ACST": "توقيت وسط أستراليا الرسمي", "CLST": "توقيت شيلي الصيفي", "ARST": "توقيت الأرجنتين الصيفي", "COST": "توقيت كولومبيا الصيفي", "OEZ": "توقيت شرق أوروبا الرسمي", "UYT": "توقيت أوروغواي الرسمي", "ADT": "التوقيت الصيفي الأطلسي", "JDT": "توقيت اليابان الصيفي", "BT": "توقيت بوتان", "AKDT": "توقيت ألاسكا الصيفي", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "HECU": "توقيت كوبا الصيفي"}, 77 } 78} 79 80// Locale returns the current translators string locale 81func (ar *ar_YE) Locale() string { 82 return ar.locale 83} 84 85// PluralsCardinal returns the list of cardinal plural rules associated with 'ar_YE' 86func (ar *ar_YE) PluralsCardinal() []locales.PluralRule { 87 return ar.pluralsCardinal 88} 89 90// PluralsOrdinal returns the list of ordinal plural rules associated with 'ar_YE' 91func (ar *ar_YE) PluralsOrdinal() []locales.PluralRule { 92 return ar.pluralsOrdinal 93} 94 95// PluralsRange returns the list of range plural rules associated with 'ar_YE' 96func (ar *ar_YE) PluralsRange() []locales.PluralRule { 97 return ar.pluralsRange 98} 99 100// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'ar_YE' 101func (ar *ar_YE) 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_YE' 122func (ar *ar_YE) 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_YE' 127func (ar *ar_YE) 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 183func (ar *ar_YE) MonthAbbreviated(month time.Month) string { 184 return ar.monthsAbbreviated[month] 185} 186 187// MonthsAbbreviated returns the locales abbreviated months 188func (ar *ar_YE) MonthsAbbreviated() []string { 189 return ar.monthsAbbreviated[1:] 190} 191 192// MonthNarrow returns the locales narrow month given the 'month' provided 193func (ar *ar_YE) MonthNarrow(month time.Month) string { 194 return ar.monthsNarrow[month] 195} 196 197// MonthsNarrow returns the locales narrow months 198func (ar *ar_YE) MonthsNarrow() []string { 199 return ar.monthsNarrow[1:] 200} 201 202// MonthWide returns the locales wide month given the 'month' provided 203func (ar *ar_YE) MonthWide(month time.Month) string { 204 return ar.monthsWide[month] 205} 206 207// MonthsWide returns the locales wide months 208func (ar *ar_YE) MonthsWide() []string { 209 return ar.monthsWide[1:] 210} 211 212// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided 213func (ar *ar_YE) WeekdayAbbreviated(weekday time.Weekday) string { 214 return ar.daysAbbreviated[weekday] 215} 216 217// WeekdaysAbbreviated returns the locales abbreviated weekdays 218func (ar *ar_YE) WeekdaysAbbreviated() []string { 219 return ar.daysAbbreviated 220} 221 222// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided 223func (ar *ar_YE) WeekdayNarrow(weekday time.Weekday) string { 224 return ar.daysNarrow[weekday] 225} 226 227// WeekdaysNarrow returns the locales narrow weekdays 228func (ar *ar_YE) WeekdaysNarrow() []string { 229 return ar.daysNarrow 230} 231 232// WeekdayShort returns the locales short weekday given the 'weekday' provided 233func (ar *ar_YE) WeekdayShort(weekday time.Weekday) string { 234 return ar.daysShort[weekday] 235} 236 237// WeekdaysShort returns the locales short weekdays 238func (ar *ar_YE) WeekdaysShort() []string { 239 return ar.daysShort 240} 241 242// WeekdayWide returns the locales wide weekday given the 'weekday' provided 243func (ar *ar_YE) WeekdayWide(weekday time.Weekday) string { 244 return ar.daysWide[weekday] 245} 246 247// WeekdaysWide returns the locales wide weekdays 248func (ar *ar_YE) WeekdaysWide() []string { 249 return ar.daysWide 250} 251 252// Decimal returns the decimal point of number 253func (ar *ar_YE) Decimal() string { 254 return ar.decimal 255} 256 257// Group returns the group of number 258func (ar *ar_YE) Group() string { 259 return ar.group 260} 261 262// Group returns the minus sign of number 263func (ar *ar_YE) Minus() string { 264 return ar.minus 265} 266 267// FmtNumber returns 'num' with digits/precision of 'v' for 'ar_YE' and handles both Whole and Real numbers based on 'v' 268func (ar *ar_YE) 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_YE' and handles both Whole and Real numbers based on 'v' 315// NOTE: 'num' passed into FmtPercent is assumed to be in percent already 316func (ar *ar_YE) 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_YE' 352func (ar *ar_YE) 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_YE' 415// in accounting notation. 416func (ar *ar_YE) 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_YE' 486func (ar *ar_YE) 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_YE' 505func (ar *ar_YE) 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_YE' 534func (ar *ar_YE) 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{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_YE' 553func (ar *ar_YE) 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{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_YE' 574func (ar *ar_YE) FmtTimeShort(t time.Time) string { 575 576 b := make([]byte, 0, 32) 577 578 h := t.Hour() 579 580 if h > 12 { 581 h -= 12 582 } 583 584 b = strconv.AppendInt(b, int64(h), 10) 585 b = append(b, ar.timeSeparator...) 586 587 if t.Minute() < 10 { 588 b = append(b, '0') 589 } 590 591 b = strconv.AppendInt(b, int64(t.Minute()), 10) 592 b = append(b, []byte{0x20}...) 593 594 if t.Hour() < 12 { 595 b = append(b, ar.periodsAbbreviated[0]...) 596 } else { 597 b = append(b, ar.periodsAbbreviated[1]...) 598 } 599 600 return string(b) 601} 602 603// FmtTimeMedium returns the medium time representation of 't' for 'ar_YE' 604func (ar *ar_YE) FmtTimeMedium(t time.Time) string { 605 606 b := make([]byte, 0, 32) 607 608 h := t.Hour() 609 610 if h > 12 { 611 h -= 12 612 } 613 614 b = strconv.AppendInt(b, int64(h), 10) 615 b = append(b, ar.timeSeparator...) 616 617 if t.Minute() < 10 { 618 b = append(b, '0') 619 } 620 621 b = strconv.AppendInt(b, int64(t.Minute()), 10) 622 b = append(b, ar.timeSeparator...) 623 624 if t.Second() < 10 { 625 b = append(b, '0') 626 } 627 628 b = strconv.AppendInt(b, int64(t.Second()), 10) 629 b = append(b, []byte{0x20}...) 630 631 if t.Hour() < 12 { 632 b = append(b, ar.periodsAbbreviated[0]...) 633 } else { 634 b = append(b, ar.periodsAbbreviated[1]...) 635 } 636 637 return string(b) 638} 639 640// FmtTimeLong returns the long time representation of 't' for 'ar_YE' 641func (ar *ar_YE) FmtTimeLong(t time.Time) string { 642 643 b := make([]byte, 0, 32) 644 645 h := t.Hour() 646 647 if h > 12 { 648 h -= 12 649 } 650 651 b = strconv.AppendInt(b, int64(h), 10) 652 b = append(b, ar.timeSeparator...) 653 654 if t.Minute() < 10 { 655 b = append(b, '0') 656 } 657 658 b = strconv.AppendInt(b, int64(t.Minute()), 10) 659 b = append(b, ar.timeSeparator...) 660 661 if t.Second() < 10 { 662 b = append(b, '0') 663 } 664 665 b = strconv.AppendInt(b, int64(t.Second()), 10) 666 b = append(b, []byte{0x20}...) 667 668 if t.Hour() < 12 { 669 b = append(b, ar.periodsAbbreviated[0]...) 670 } else { 671 b = append(b, ar.periodsAbbreviated[1]...) 672 } 673 674 b = append(b, []byte{0x20}...) 675 676 tz, _ := t.Zone() 677 b = append(b, tz...) 678 679 return string(b) 680} 681 682// FmtTimeFull returns the full time representation of 't' for 'ar_YE' 683func (ar *ar_YE) FmtTimeFull(t time.Time) string { 684 685 b := make([]byte, 0, 32) 686 687 h := t.Hour() 688 689 if h > 12 { 690 h -= 12 691 } 692 693 b = strconv.AppendInt(b, int64(h), 10) 694 b = append(b, ar.timeSeparator...) 695 696 if t.Minute() < 10 { 697 b = append(b, '0') 698 } 699 700 b = strconv.AppendInt(b, int64(t.Minute()), 10) 701 b = append(b, ar.timeSeparator...) 702 703 if t.Second() < 10 { 704 b = append(b, '0') 705 } 706 707 b = strconv.AppendInt(b, int64(t.Second()), 10) 708 b = append(b, []byte{0x20}...) 709 710 if t.Hour() < 12 { 711 b = append(b, ar.periodsAbbreviated[0]...) 712 } else { 713 b = append(b, ar.periodsAbbreviated[1]...) 714 } 715 716 b = append(b, []byte{0x20}...) 717 718 tz, _ := t.Zone() 719 720 if btz, ok := ar.timezones[tz]; ok { 721 b = append(b, btz...) 722 } else { 723 b = append(b, tz...) 724 } 725 726 return string(b) 727} 728