1 package lo_LA
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 lo_LA 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
25 currencyNegativePrefix string
26 monthsAbbreviated []string
27 monthsNarrow []string
28 monthsWide []string
29 daysAbbreviated []string
30 daysNarrow []string
31 daysShort []string
32 daysWide []string
33 periodsAbbreviated []string
34 periodsNarrow []string
35 periodsShort []string
36 periodsWide []string
37 erasAbbreviated []string
38 erasNarrow []string
39 erasWide []string
40 timezones map[string]string
41 }
42
43
44 func New() locales.Translator {
45 return &lo_LA{
46 locale: "lo_LA",
47 pluralsCardinal: []locales.PluralRule{6},
48 pluralsOrdinal: []locales.PluralRule{2, 6},
49 pluralsRange: []locales.PluralRule{6},
50 decimal: ",",
51 group: ".",
52 percent: "%",
53 perMille: "‰",
54 timeSeparator: ":",
55 inifinity: "∞",
56 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", "MRU", "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", "UYW", "UZS", "VEB", "VEF", "VES", "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"},
57 currencyNegativePrefix: "-",
58 monthsAbbreviated: []string{"", "ມ.ກ.", "ກ.ພ.", "ມ.ນ.", "ມ.ສ.", "ພ.ພ.", "ມິ.ຖ.", "ກ.ລ.", "ສ.ຫ.", "ກ.ຍ.", "ຕ.ລ.", "ພ.ຈ.", "ທ.ວ."},
59 monthsNarrow: []string{"", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"},
60 monthsWide: []string{"", "ມັງກອນ", "ກຸມພາ", "ມີນາ", "ເມສາ", "ພຶດສະພາ", "ມິຖຸນາ", "ກໍລະກົດ", "ສິງຫາ", "ກັນຍາ", "ຕຸລາ", "ພະຈິກ", "ທັນວາ"},
61 daysAbbreviated: []string{"ອາທິດ", "ຈັນ", "ອັງຄານ", "ພຸດ", "ພະຫັດ", "ສຸກ", "ເສົາ"},
62 daysNarrow: []string{"ອາ", "ຈ", "ອ", "ພ", "ພຫ", "ສຸ", "ສ"},
63 daysShort: []string{"ອາ.", "ຈ.", "ອ.", "ພ.", "ພຫ.", "ສຸ.", "ສ."},
64 daysWide: []string{"ວັນອາທິດ", "ວັນຈັນ", "ວັນອັງຄານ", "ວັນພຸດ", "ວັນພະຫັດ", "ວັນສຸກ", "ວັນເສົາ"},
65 periodsAbbreviated: []string{"ກ່ອນທ່ຽງ", "ຫຼັງທ່ຽງ"},
66 periodsNarrow: []string{"", ""},
67 periodsWide: []string{"ກ່ອນທ່ຽງ", "ຫຼັງທ່ຽງ"},
68 erasAbbreviated: []string{"ກ່ອນ ຄ.ສ.", "ຄ.ສ."},
69 erasNarrow: []string{"", ""},
70 erasWide: []string{"ກ່ອນຄຣິດສັກກະລາດ", "ຄຣິດສັກກະລາດ"},
71 timezones: map[string]string{"ACDT": "ເວ\u200bລາ\u200bຕອນ\u200bທ່ຽງ\u200bອອສ\u200bເຕຣ\u200bເລຍ\u200bກາງ", "ACST": "ເວ\u200bລາມາດ\u200bຕະ\u200bຖານອອ\u200bສ\u200bເຕຣ\u200bເລຍ\u200bກ\u200bາງ", "ACWDT": "ເວ\u200bລາ\u200bຕອນ\u200bທ່ຽງ\u200bອອສ\u200bເຕຣ\u200bລຽນ\u200bກາງ\u200bຕາ\u200bເວັນ\u200bຕົກ", "ACWST": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານອອສ\u200bເຕຣ\u200bລຽນ\u200bກາງ\u200bຕາ\u200bເວັນ\u200bຕົກ", "ADT": "ເວລາກາງເວັນຂອງອາແລນຕິກ", "AEDT": "ເວ\u200bລາ\u200bຕອນ\u200bທ່ຽງ\u200bອອສ\u200bເຕຣ\u200bລຽນ\u200bຕາ\u200bເວັນ\u200bອອກ", "AEST": "ເວ\u200bລາ\u200bມາດຕະຖານ\u200b\u200b\u200bອອສ\u200bເຕຣ\u200bລຽນ\u200bຕາ\u200bເວັນ\u200bອອກ", "AKDT": "ເວລາກາງເວັນອະລັສກາ", "AKST": "ເວລາມາດຕະຖານອະລັສກາ", "ARST": "\u200bເວ\u200bລາ\u200bລະ\u200bດູ\u200bຮ້ອນ\u200bອາ\u200bເຈນ\u200bທິ\u200bນາ", "ART": "\u200bເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານອາ\u200bເຈນ\u200bທິ\u200bນາ", "AST": "ເວລາມາດຕະຖານຂອງອາແລນຕິກ", "AWDT": "ເວ\u200bລາ\u200bຕອນ\u200bທ່ຽງ\u200bອອສ\u200bເຕຣ\u200bລຽນ\u200bຕາ\u200bເວັນ\u200bຕົກ", "AWST": "ເວ\u200bລາ\u200bມາ\u200bດ\u200bຕະ\u200bຖານອອສ\u200bເຕຣ\u200bລຽນ\u200bຕາ\u200bເວັນ\u200bຕົກ", "BOT": "ເວ\u200bລາ\u200bໂບ\u200bລິ\u200bເວຍ", "BT": "ເວ\u200bລາ\u200bພູ\u200bຖານ", "CAT": "ເວ\u200bລາ\u200bອາ\u200bຟຣິ\u200bກາ\u200bກາງ", "CDT": "ເວລາກາງເວັນກາງ", "CHADT": "ເວ\u200bລາ\u200bຕອນ\u200bທ່ຽງ\u200bຊາ\u200bທາມ", "CHAST": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານ\u200bຊາ\u200bທາມ", "CLST": "ເວ\u200bລາ\u200bລະ\u200bດູ\u200bຮ້ອນຊິ\u200bລີ", "CLT": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານຊິ\u200bລີ", "COST": "ເວລາລະດູຮ້ອນໂຄລໍາເບຍ", "COT": "ເວລາມາດຕະຖານໂຄລຳເບຍ", "CST": "ເວລາມາດຕະຖານກາງ", "ChST": "ເວ\u200bລາ\u200bຈາ\u200bໂມ\u200bໂຣ", "EAT": "ເວ\u200bລາ\u200bອາ\u200bຟຣິ\u200bກາ\u200bຕາ\u200bເວັນ\u200bອອກ", "ECT": "ເວ\u200bລາ\u200bເອ\u200bກົວ\u200bດໍ", "EDT": "ເວລາກາງເວັນຕາເວັນອອກ", "EST": "ເວລາມາດຕະຖານຕາເວັນອອກ", "GFT": "ເວ\u200bລາ\u200bເຟ\u200bຣນ\u200bຊ໌\u200bເກຍ\u200bນາ", "GMT": "ເວ\u200bລາກຣີນ\u200bວິ\u200bຊ", "GST": "ເວ\u200bລາ\u200bກູ\u200bລ\u200b໌ຟ", "GYT": "ເວລາກາຍອານາ", "HADT": "ເວລາຕອນທ່ຽງຮາວາຍ-ເອລູທຽນ", "HAST": "ເວລາມາດຕະຖານຮາວາຍ-ເອລູທຽນ", "HAT": "ເວລາກາງເວັນນິວຟາວແລນ", "HECU": "ເວລາກາງເວັນຄິວບາ", "HEEG": "ເວລາລະດູຮ້ອນກຣີນແລນຕາເວັນອອກ", "HENOMX": "ເວລາກາງເວັນເມັກຊິກັນນອດເວສ", "HEOG": "ເວລາຕອນທ່ຽງກຣີນແລນຕາເວັນຕົກ", "HEPM": "\u200bເວ\u200bລາຕອນ\u200bທ່ຽງເຊນ\u200bປີ\u200bແອ ແລະ\u200bມິ\u200bກົວ\u200bລອນ", "HEPMX": "ເວລາກາງເວັນແປຊິຟິກເມັກຊິກັນ", "HKST": "\u200bເວ\u200bລາ\u200bລະ\u200bດູ\u200bຮ້ອນ\u200bຮອງ\u200bກົງ", "HKT": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານ\u200bຮອງ\u200bກົງ", "HNCU": "ເວລາມາດຕະຖານຂອງຄິວບາ", "HNEG": "ເວລາມາດຕະຖານຕາເວັນອອກກຣີນແລນ", "HNNOMX": "\u200bເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານນອດ\u200bເວ\u200bສ\u200bເມັກ\u200bຊິ\u200bໂກ", "HNOG": "ເວລາມາດຕະຖານກຣີນແລນຕາເວັນຕົກ", "HNPM": "\u200bເວ\u200bລາມາດ\u200bຕະ\u200bຖານເຊນ\u200bປີ\u200bແອ ແລະ\u200bມິ\u200bກົວ\u200bລອນ", "HNPMX": "ເວລາມາດຕະຖານແປຊິຟິກເມັກຊິກັນ", "HNT": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານ\u200bນິວ\u200bຟາວ\u200bແລນ", "IST": "ເວລາ ອິນເດຍ", "JDT": "ເວ\u200bລາ\u200bຕອນ\u200bທ່ຽງ\u200bຍີ່\u200bປຸ່ນ", "JST": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານ\u200bຍີ່\u200bປຸ່ນ", "LHDT": "\u200bເວ\u200bລ\u200bສາ\u200bຕອນ\u200b\u200bທ່ຽງ\u200bລອດ\u200bເຮົາ\u200b", "LHST": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານ\u200bລອດ\u200bເຮົາ", "MDT": "ເວລາກາງເວັນແຖບພູເຂົາ", "MESZ": "\u200bເວ\u200bລາ\u200bລະ\u200bດູ\u200bຮ້ອນ\u200bຢູ\u200bໂຣບ\u200bກາງ", "MEZ": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານ\u200bຢູ\u200bໂຣບກາງ", "MST": "ເວລາມາດຕະຖານແຖບພູເຂົາ", "MYT": "ເວ\u200bລາ\u200bມາ\u200bເລ\u200bເຊຍ", "NZDT": "ເວ\u200bລາ\u200bຕອນ\u200bທ່ຽງ\u200bນິວ\u200bຊີ\u200bແລນ", "NZST": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານນິວ\u200bຊີ\u200bແລນ", "OESZ": "ເວ\u200bລາ\u200bລະ\u200bດູ\u200bຮ້ອນຢູ\u200bໂຣບ\u200bຕາ\u200bເວັນ\u200bອອກ", "OEZ": "ເວ\u200bລາ\u200bມາ\u200bດ\u200bຕະ\u200bຖານ\u200bຢູ\u200bໂຣບ\u200bຕາ\u200bເວັນ\u200bອອກ", "PDT": "ເວລາກາງເວັນແປຊິຟິກ", "PST": "ເວລາມາດຕະຖານແປຊິຟິກ", "SAST": "ເວ\u200bລາ\u200bອາ\u200bຟຣິ\u200bກາ\u200bໃຕ້", "SGT": "ເວ\u200bລາ\u200bສິງ\u200bກະ\u200bໂປ", "SRT": "ເວ\u200bລາ\u200bຊຸ\u200bຣິ\u200bນາມ", "TMST": "ເວລາລະດູຮ້ອນຕວກເມນິສຖານ", "TMT": "ເວລາມາດຕະຖານຕວກເມນິສຖານ", "UYST": "ເວ\u200bລາ\u200bລະ\u200bດູ\u200bຮ້ອນ\u200bອູ\u200bຣູ\u200bກວຍ", "UYT": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານ\u200bອູ\u200bຣູ\u200bກວຍ", "VET": "ເວ\u200bລາ\u200bເວ\u200bເນ\u200bຊູ\u200bເອ\u200bລາ", "WARST": "ເວ\u200bລາ\u200bລະ\u200bດູ\u200bຮ້ອນເວ\u200bສ\u200bເທິນອາ\u200bເຈນ\u200bທິ\u200bນາ", "WART": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານເວ\u200bສ\u200bເທິນອາ\u200bເຈນ\u200bທິ\u200bນາ", "WAST": "ເວ\u200bລາ\u200bລະ\u200bດູ\u200bຮ້ອນ\u200bອາ\u200bຟຣິ\u200bກາ\u200bຕາ\u200bເວັນ\u200bຕົກ", "WAT": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານ\u200bອາ\u200bຟຣິ\u200bກາ\u200bຕາ\u200bເວັນ\u200bຕົກ", "WESZ": "ເວ\u200bລາ\u200bລະ\u200bດູ\u200bຮ້ອນຢູ\u200bໂຣບ\u200bຕາ\u200bເວັນ\u200bຕົກ", "WEZ": "ເວ\u200bລາ\u200bມາດ\u200bຕະ\u200bຖານຢູ\u200bໂຣບ\u200bຕາ\u200bເວັນ\u200bຕົກ", "WIB": "ເວ\u200bລາ\u200bອິນ\u200bໂດ\u200bເນ\u200bເຊຍ\u200bຕາ\u200bເວັນ\u200bຕົກ", "WIT": "ເວ\u200bລາ\u200bອິນ\u200bໂດ\u200bເນ\u200bເຊຍ\u200bຕາ\u200bເວັນ\u200bອອກ", "WITA": "ເວ\u200bລາ\u200bອິນ\u200bໂດ\u200bເນ\u200bເຊຍ\u200bກາງ", "∅∅∅": "ເວ\u200bລາ\u200bລະ\u200bດູ\u200bຮ້ອນອາ\u200bໂຊ\u200bເຣ\u200bສ"},
72 }
73 }
74
75
76 func (lo *lo_LA) Locale() string {
77 return lo.locale
78 }
79
80
81 func (lo *lo_LA) PluralsCardinal() []locales.PluralRule {
82 return lo.pluralsCardinal
83 }
84
85
86 func (lo *lo_LA) PluralsOrdinal() []locales.PluralRule {
87 return lo.pluralsOrdinal
88 }
89
90
91 func (lo *lo_LA) PluralsRange() []locales.PluralRule {
92 return lo.pluralsRange
93 }
94
95
96 func (lo *lo_LA) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
97 return locales.PluralRuleOther
98 }
99
100
101 func (lo *lo_LA) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
102
103 n := math.Abs(num)
104
105 if n == 1 {
106 return locales.PluralRuleOne
107 }
108
109 return locales.PluralRuleOther
110 }
111
112
113 func (lo *lo_LA) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
114 return locales.PluralRuleOther
115 }
116
117
118 func (lo *lo_LA) MonthAbbreviated(month time.Month) string {
119 return lo.monthsAbbreviated[month]
120 }
121
122
123 func (lo *lo_LA) MonthsAbbreviated() []string {
124 return lo.monthsAbbreviated[1:]
125 }
126
127
128 func (lo *lo_LA) MonthNarrow(month time.Month) string {
129 return lo.monthsNarrow[month]
130 }
131
132
133 func (lo *lo_LA) MonthsNarrow() []string {
134 return lo.monthsNarrow[1:]
135 }
136
137
138 func (lo *lo_LA) MonthWide(month time.Month) string {
139 return lo.monthsWide[month]
140 }
141
142
143 func (lo *lo_LA) MonthsWide() []string {
144 return lo.monthsWide[1:]
145 }
146
147
148 func (lo *lo_LA) WeekdayAbbreviated(weekday time.Weekday) string {
149 return lo.daysAbbreviated[weekday]
150 }
151
152
153 func (lo *lo_LA) WeekdaysAbbreviated() []string {
154 return lo.daysAbbreviated
155 }
156
157
158 func (lo *lo_LA) WeekdayNarrow(weekday time.Weekday) string {
159 return lo.daysNarrow[weekday]
160 }
161
162
163 func (lo *lo_LA) WeekdaysNarrow() []string {
164 return lo.daysNarrow
165 }
166
167
168 func (lo *lo_LA) WeekdayShort(weekday time.Weekday) string {
169 return lo.daysShort[weekday]
170 }
171
172
173 func (lo *lo_LA) WeekdaysShort() []string {
174 return lo.daysShort
175 }
176
177
178 func (lo *lo_LA) WeekdayWide(weekday time.Weekday) string {
179 return lo.daysWide[weekday]
180 }
181
182
183 func (lo *lo_LA) WeekdaysWide() []string {
184 return lo.daysWide
185 }
186
187
188 func (lo *lo_LA) Decimal() string {
189 return lo.decimal
190 }
191
192
193 func (lo *lo_LA) Group() string {
194 return lo.group
195 }
196
197
198 func (lo *lo_LA) Minus() string {
199 return lo.minus
200 }
201
202
203 func (lo *lo_LA) FmtNumber(num float64, v uint64) string {
204
205 return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
206 }
207
208
209
210 func (lo *lo_LA) FmtPercent(num float64, v uint64) string {
211 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
212 l := len(s) + 2
213 b := make([]byte, 0, l)
214
215 for i := len(s) - 1; i >= 0; i-- {
216
217 if s[i] == '.' {
218 b = append(b, lo.decimal[0])
219 continue
220 }
221
222 b = append(b, s[i])
223 }
224
225 if num < 0 {
226 b = append(b, lo.minus[0])
227 }
228
229
230 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
231 b[i], b[j] = b[j], b[i]
232 }
233
234 b = append(b, lo.percent...)
235
236 return string(b)
237 }
238
239
240 func (lo *lo_LA) FmtCurrency(num float64, v uint64, currency currency.Type) string {
241
242 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
243 symbol := lo.currencies[currency]
244 l := len(s) + len(symbol) + 1 + 1*len(s[:len(s)-int(v)-1])/3
245 count := 0
246 inWhole := v == 0
247 b := make([]byte, 0, l)
248
249 for i := len(s) - 1; i >= 0; i-- {
250
251 if s[i] == '.' {
252 b = append(b, lo.decimal[0])
253 inWhole = true
254 continue
255 }
256
257 if inWhole {
258 if count == 3 {
259 b = append(b, lo.group[0])
260 count = 1
261 } else {
262 count++
263 }
264 }
265
266 b = append(b, s[i])
267 }
268
269 for j := len(symbol) - 1; j >= 0; j-- {
270 b = append(b, symbol[j])
271 }
272
273 if num < 0 {
274 b = append(b, lo.minus[0])
275 }
276
277
278 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
279 b[i], b[j] = b[j], b[i]
280 }
281
282 if int(v) < 2 {
283
284 if v == 0 {
285 b = append(b, lo.decimal...)
286 }
287
288 for i := 0; i < 2-int(v); i++ {
289 b = append(b, '0')
290 }
291 }
292
293 return string(b)
294 }
295
296
297
298 func (lo *lo_LA) FmtAccounting(num float64, v uint64, currency currency.Type) string {
299
300 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
301 symbol := lo.currencies[currency]
302 l := len(s) + len(symbol) + 2 + 1*len(s[:len(s)-int(v)-1])/3
303 count := 0
304 inWhole := v == 0
305 b := make([]byte, 0, l)
306
307 for i := len(s) - 1; i >= 0; i-- {
308
309 if s[i] == '.' {
310 b = append(b, lo.decimal[0])
311 inWhole = true
312 continue
313 }
314
315 if inWhole {
316 if count == 3 {
317 b = append(b, lo.group[0])
318 count = 1
319 } else {
320 count++
321 }
322 }
323
324 b = append(b, s[i])
325 }
326
327 if num < 0 {
328
329 for j := len(symbol) - 1; j >= 0; j-- {
330 b = append(b, symbol[j])
331 }
332
333 b = append(b, lo.currencyNegativePrefix[0])
334
335 } else {
336
337 for j := len(symbol) - 1; j >= 0; j-- {
338 b = append(b, symbol[j])
339 }
340
341 }
342
343
344 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
345 b[i], b[j] = b[j], b[i]
346 }
347
348 if int(v) < 2 {
349
350 if v == 0 {
351 b = append(b, lo.decimal...)
352 }
353
354 for i := 0; i < 2-int(v); i++ {
355 b = append(b, '0')
356 }
357 }
358
359 return string(b)
360 }
361
362
363 func (lo *lo_LA) FmtDateShort(t time.Time) string {
364
365 b := make([]byte, 0, 32)
366
367 b = strconv.AppendInt(b, int64(t.Day()), 10)
368 b = append(b, []byte{0x2f}...)
369 b = strconv.AppendInt(b, int64(t.Month()), 10)
370 b = append(b, []byte{0x2f}...)
371
372 if t.Year() > 0 {
373 b = strconv.AppendInt(b, int64(t.Year()), 10)
374 } else {
375 b = strconv.AppendInt(b, int64(-t.Year()), 10)
376 }
377
378 return string(b)
379 }
380
381
382 func (lo *lo_LA) FmtDateMedium(t time.Time) string {
383
384 b := make([]byte, 0, 32)
385
386 b = strconv.AppendInt(b, int64(t.Day()), 10)
387 b = append(b, []byte{0x20}...)
388 b = append(b, lo.monthsAbbreviated[t.Month()]...)
389 b = append(b, []byte{0x20}...)
390
391 if t.Year() > 0 {
392 b = strconv.AppendInt(b, int64(t.Year()), 10)
393 } else {
394 b = strconv.AppendInt(b, int64(-t.Year()), 10)
395 }
396
397 return string(b)
398 }
399
400
401 func (lo *lo_LA) FmtDateLong(t time.Time) string {
402
403 b := make([]byte, 0, 32)
404
405 b = strconv.AppendInt(b, int64(t.Day()), 10)
406 b = append(b, []byte{0x20}...)
407 b = append(b, lo.monthsWide[t.Month()]...)
408 b = append(b, []byte{0x20}...)
409
410 if t.Year() > 0 {
411 b = strconv.AppendInt(b, int64(t.Year()), 10)
412 } else {
413 b = strconv.AppendInt(b, int64(-t.Year()), 10)
414 }
415
416 return string(b)
417 }
418
419
420 func (lo *lo_LA) FmtDateFull(t time.Time) string {
421
422 b := make([]byte, 0, 32)
423
424 b = append(b, lo.daysWide[t.Weekday()]...)
425 b = append(b, []byte{0x20, 0xe0, 0xba, 0x97, 0xe0, 0xba, 0xb5, 0x20}...)
426 b = strconv.AppendInt(b, int64(t.Day()), 10)
427 b = append(b, []byte{0x20}...)
428 b = append(b, lo.monthsWide[t.Month()]...)
429 b = append(b, []byte{0x20}...)
430
431 if t.Year() < 0 {
432 b = append(b, lo.erasWide[0]...)
433 } else {
434 b = append(b, lo.erasWide[1]...)
435 }
436
437 b = append(b, []byte{0x20}...)
438
439 if t.Year() > 0 {
440 b = strconv.AppendInt(b, int64(t.Year()), 10)
441 } else {
442 b = strconv.AppendInt(b, int64(-t.Year()), 10)
443 }
444
445 return string(b)
446 }
447
448
449 func (lo *lo_LA) FmtTimeShort(t time.Time) string {
450
451 b := make([]byte, 0, 32)
452
453 b = strconv.AppendInt(b, int64(t.Hour()), 10)
454 b = append(b, lo.timeSeparator...)
455
456 if t.Minute() < 10 {
457 b = append(b, '0')
458 }
459
460 b = strconv.AppendInt(b, int64(t.Minute()), 10)
461
462 return string(b)
463 }
464
465
466 func (lo *lo_LA) FmtTimeMedium(t time.Time) string {
467
468 b := make([]byte, 0, 32)
469
470 b = strconv.AppendInt(b, int64(t.Hour()), 10)
471 b = append(b, lo.timeSeparator...)
472
473 if t.Minute() < 10 {
474 b = append(b, '0')
475 }
476
477 b = strconv.AppendInt(b, int64(t.Minute()), 10)
478 b = append(b, lo.timeSeparator...)
479
480 if t.Second() < 10 {
481 b = append(b, '0')
482 }
483
484 b = strconv.AppendInt(b, int64(t.Second()), 10)
485
486 return string(b)
487 }
488
489
490 func (lo *lo_LA) FmtTimeLong(t time.Time) string {
491
492 b := make([]byte, 0, 32)
493
494 b = strconv.AppendInt(b, int64(t.Hour()), 10)
495 b = append(b, []byte{0x20, 0xe0, 0xbb, 0x82, 0xe0, 0xba, 0xa1, 0xe0, 0xba, 0x87, 0x20}...)
496 b = strconv.AppendInt(b, int64(t.Minute()), 10)
497 b = append(b, []byte{0x20, 0xe0, 0xba, 0x99, 0xe0, 0xba, 0xb2, 0xe0, 0xba, 0x97, 0xe0, 0xba, 0xb5, 0x20}...)
498
499 if t.Second() < 10 {
500 b = append(b, '0')
501 }
502
503 b = strconv.AppendInt(b, int64(t.Second()), 10)
504 b = append(b, []byte{0x20, 0xe0, 0xba, 0xa7, 0xe0, 0xba, 0xb4, 0xe0, 0xba, 0x99, 0xe0, 0xba, 0xb2, 0xe0, 0xba, 0x97, 0xe0, 0xba, 0xb5, 0x20}...)
505
506 tz, _ := t.Zone()
507 b = append(b, tz...)
508
509 return string(b)
510 }
511
512
513 func (lo *lo_LA) FmtTimeFull(t time.Time) string {
514
515 b := make([]byte, 0, 32)
516
517 b = strconv.AppendInt(b, int64(t.Hour()), 10)
518 b = append(b, []byte{0x20, 0xe0, 0xbb, 0x82, 0xe0, 0xba, 0xa1, 0xe0, 0xba, 0x87, 0x20}...)
519 b = strconv.AppendInt(b, int64(t.Minute()), 10)
520 b = append(b, []byte{0x20, 0xe0, 0xba, 0x99, 0xe0, 0xba, 0xb2, 0xe0, 0xba, 0x97, 0xe0, 0xba, 0xb5, 0x20}...)
521
522 if t.Second() < 10 {
523 b = append(b, '0')
524 }
525
526 b = strconv.AppendInt(b, int64(t.Second()), 10)
527 b = append(b, []byte{0x20, 0xe0, 0xba, 0xa7, 0xe0, 0xba, 0xb4, 0xe0, 0xba, 0x99, 0xe0, 0xba, 0xb2, 0xe0, 0xba, 0x97, 0xe0, 0xba, 0xb5, 0x20}...)
528
529 tz, _ := t.Zone()
530
531 if btz, ok := lo.timezones[tz]; ok {
532 b = append(b, btz...)
533 } else {
534 b = append(b, tz...)
535 }
536
537 return string(b)
538 }
539
View as plain text