8 "github.com/go-playground/locales"
9 "github.com/go-playground/locales/currency"
14 pluralsCardinal []locales.PluralRule
15 pluralsOrdinal []locales.PluralRule
16 pluralsRange []locales.PluralRule
24 currencies []string // idx = enum of currency code
25 currencyPositivePrefix string
26 currencyPositiveSuffix string
27 currencyNegativePrefix string
28 currencyNegativeSuffix string
29 monthsAbbreviated []string
32 daysAbbreviated []string
36 periodsAbbreviated []string
37 periodsNarrow []string
40 erasAbbreviated []string
43 timezones map[string]string
46 // New returns a new instance of translator for the 'pa_Arab' locale
47 func New() locales.Translator {
50 pluralsCardinal: []locales.PluralRule{2, 6},
51 pluralsOrdinal: []locales.PluralRule{6},
52 pluralsRange: []locales.PluralRule{2, 6},
60 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", "ر", "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"},
61 currencyPositivePrefix: " ",
62 currencyPositiveSuffix: "K",
63 currencyNegativePrefix: " ",
64 currencyNegativeSuffix: "K",
65 monthsAbbreviated: []string{"", "ਜਨ", "ਫ਼ਰ", "ਮਾਰਚ", "ਅਪ੍ਰੈ", "ਮਈ", "ਜੂਨ", "ਜੁਲਾ", "ਅਗ", "ਸਤੰ", "ਅਕਤੂ", "ਨਵੰ", "ਦਸੰ"},
66 monthsNarrow: []string{"", "ਜ", "ਫ਼", "ਮਾ", "ਅ", "ਮ", "ਜੂ", "ਜੁ", "ਅ", "ਸ", "ਅ", "ਨ", "ਦ"},
67 monthsWide: []string{"", "جنوری", "فروری", "مارچ", "اپریل", "مئ", "جون", "جولائی", "اگست", "ستمبر", "اکتوبر", "نومبر", "دسمبر"},
68 daysAbbreviated: []string{"ਐਤ", "ਸੋਮ", "ਮੰਗਲ", "ਬੁੱਧ", "ਵੀਰ", "ਸ਼ੁੱਕਰ", "ਸ਼ਨਿੱਚਰ"},
69 daysNarrow: []string{"ਐ", "ਸੋ", "ਮੰ", "ਬੁੱ", "ਵੀ", "ਸ਼ੁੱ", "ਸ਼"},
70 daysShort: []string{"ਐਤ", "ਸੋਮ", "ਮੰਗ", "ਬੁੱਧ", "ਵੀਰ", "ਸ਼ੁੱਕ", "ਸ਼ਨਿੱ"},
71 daysWide: []string{"اتوار", "پیر", "منگل", "بُدھ", "جمعرات", "جمعہ", "ہفتہ"},
72 periodsAbbreviated: []string{"ਪੂ.ਦੁ.", "ਬਾ.ਦੁ."},
73 periodsNarrow: []string{"ਸ.", "ਸ਼."},
74 periodsWide: []string{"ਪੂ.ਦੁ.", "ਬਾ.ਦੁ."},
75 erasAbbreviated: []string{"ايساپورو", "سں"},
76 erasNarrow: []string{"", ""},
77 erasWide: []string{"ايساپورو", "سں"},
78 timezones: map[string]string{"AST": "ਅਟਲਾਂਟਿਕ ਮਿਆਰੀ ਵੇਲਾ", "COST": "ਕੋਲੰਬੀਆ ਗਰਮੀਆਂ ਦਾ ਵੇਲਾ", "CAT": "ਕੇਂਦਰੀ ਅਫਰੀਕਾ ਵੇਲਾ", "PDT": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਪੈਸਿਫਿਕ ਪ੍ਰਕਾਸ਼ ਵੇਲਾ", "CST": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਕੇਂਦਰੀ ਮਿਆਰੀ ਵੇਲਾ", "HNCU": "ਕਿਊਬਾ ਮਿਆਰੀ ਵੇਲਾ", "BOT": "ਬੋਲੀਵੀਆ ਵੇਲਾ", "CHAST": "ਚੈਥਮ ਮਿਆਰੀ ਵੇਲਾ", "HAST": "ਹਵਾਈ-ਅਲੇਯੂਸ਼ਿਅਨ ਮਿਆਰੀ ਵੇਲਾ", "GFT": "ਫ੍ਰੈਂਚ ਗੁਏਨਾ ਵੇਲਾ", "EST": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਪੂਰਬੀ ਮਿਆਰੀ ਵੇਲਾ", "ECT": "ਇਕਵੇਡੋਰ ਵੇਲਾ", "∅∅∅": "∅∅∅", "HNNOMX": "ਉੱਤਰ ਪੱਛਮੀ ਮੈਕਸੀਕੋ ਮਿਆਰੀ ਵੇਲਾ", "WART": "ਪੱਛਮੀ ਅਰਜਨਟੀਨਾ ਮਿਆਰੀ ਵੇਲਾ", "GMT": "ਗ੍ਰੀਨਵਿਚ ਮੀਨ ਵੇਲਾ", "HEPM": "ਸੈਂਟ ਪੀਅਰੇ ਅਤੇ ਮਿਕੇਲਨ ਪ੍ਰਕਾਸ਼ ਵੇਲਾ", "ACWDT": "ਆਸਟ੍ਰੇਲੀਆਈ ਕੇਂਦਰੀ ਪੱਛਮੀ ਪ੍ਰਕਾਸ਼ ਵੇਲਾ", "AWDT": "ਆਸਟ੍ਰੇਲੀਆਈ ਪੱਛਮੀ ਪ੍ਰਕਾਸ਼ ਵੇਲਾ", "UYST": "ਉਰੂਗਵੇ ਗਰਮੀਆਂ ਦਾ ਵੇਲਾ", "MEZ": "ਮੱਧ ਯੂਰਪੀ ਮਿਆਰੀ ਵੇਲਾ", "WAT": "ਪੱਛਮੀ ਅਫਰੀਕਾ ਮਿਆਰੀ ਵੇਲਾ", "GYT": "ਗੁਯਾਨਾ ਵੇਲਾ", "WEZ": "ਪੱਛਮੀ ਯੂਰਪੀ ਮਿਆਰੀ ਵੇਲਾ", "AWST": "ਆਸਟ੍ਰੇਲੀਆਈ ਪੱਛਮੀ ਮਿਆਰੀ ਵੇਲਾ", "COT": "ਕੋਲੰਬੀਆ ਮਿਆਰੀ ਵੇਲਾ", "HEPMX": "ਮੈਕਸੀਕਨ ਪੈਸਿਫਿਕ ਪ੍ਰਕਾਸ਼ ਵੇਲਾ", "CDT": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਕੇਂਦਰੀ ਪ੍ਰਕਾਸ਼ ਵੇਲਾ", "HADT": "ਹਵਾਈ-ਅਲੇਯੂਸ਼ਿਅਨ ਪ੍ਰਕਾਸ਼ ਵੇਲਾ", "NZST": "ਨਿਊਜ਼ੀਲੈਂਡ ਮਿਆਰੀ ਵੇਲਾ", "ART": "ਅਰਜਨਟੀਨਾ ਮਿਆਰੀ ਵੇਲਾ", "ARST": "ਅਰਜਨਟੀਨਾ ਗਰਮੀਆਂ ਦਾ ਵੇਲਾ", "CLST": "ਚਿਲੀ ਗਰਮੀਆਂ ਦਾ ਵੇਲਾ", "AKST": "ਅਲਾਸਕਾ ਮਿਆਰੀ ਵੇਲਾ", "HNPMX": "ਮੈਕਸੀਕਨ ਪੈਸਿਫਿਕ ਮਿਆਰੀ ਵੇਲਾ", "MST": "ਮਕਾਉ ਮਿਆਰੀ ਸਮਾਂ", "PST": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਪੈਸਿਫਿਕ ਮਿਆਰੀ ਵੇਲਾ", "ACST": "ਆਸਟ੍ਰੇਲੀਆਈ ਕੇਂਦਰੀ ਮਿਆਰੀ ਵੇਲਾ", "LHST": "ਲੌਰਡ ਹੋਵੇ ਮਿਆਰੀ ਵੇਲਾ", "AKDT": "ਅਲਾਸਕਾ ਪ੍ਰਕਾਸ਼ ਵੇਲਾ", "MYT": "ਮਲੇਸ਼ੀਆ ਵੇਲਾ", "TMST": "ਤੁਰਕਮੇਨਿਸਤਾਨ ਗਰਮੀਆਂ ਦਾ ਵੇਲਾ", "LHDT": "ਲੌਰਡ ਹੋਵੇ ਪ੍ਰਕਾਸ਼ ਵੇਲਾ", "WESZ": "ਪੱਛਮੀ ਯੂਰਪੀ ਗਰਮੀਆਂ ਦਾ ਵੇਲਾ", "UYT": "ਉਰੂਗਵੇ ਮਿਆਰੀ ਵੇਲਾ", "WARST": "ਪੱਛਮੀ ਅਰਜਨਟੀਨਾ ਗਰਮੀਆਂ ਦਾ ਵੇਲਾ", "IST": "ਭਾਰਤੀ ਮਿਆਰੀ ਵੇਲਾ", "ADT": "ਅਟਲਾਂਟਿਕ ਪ੍ਰਕਾਸ਼ ਵੇਲਾ", "EDT": "ਉੱਤਰੀ ਅਮਰੀਕੀ ਪੂਰਬੀ ਪ੍ਰਕਾਸ਼ ਵੇਲਾ", "SGT": "ਸਿੰਗਾਪੁਰ ਮਿਆਰੀ ਵੇਲਾ", "TMT": "ਤੁਰਕਮੇਨਿਸਤਾਨ ਮਿਆਰੀ ਵੇਲਾ", "HENOMX": "ਉੱਤਰ ਪੱਛਮੀ ਮੈਕਸੀਕੋ ਪ੍ਰਕਾਸ਼ ਵੇਲਾ", "AEST": "ਆਸਟ੍ਰੇਲੀਆਈ ਪੂਰਬੀ ਮਿਆਰੀ ਵੇਲਾ", "HEEG": "ਪੂਰਬੀ ਗ੍ਰੀਨਲੈਂਡ ਗਰਮੀਆਂ ਦਾ ਵੇਲਾ", "HKST": "ਹਾਂਗ ਕਾਂਗ ਗਰਮੀਆਂ ਦਾ ਵੇਲਾ", "WIB": "ਪੱਛਮੀ ਇੰਡੋਨੇਸ਼ੀਆ ਵੇਲਾ", "BT": "ਭੂਟਾਨ ਵੇਲਾ", "SRT": "ਸੂਰੀਨਾਮ ਵੇਲਾ", "OESZ": "ਪੂਰਬੀ ਯੂਰਪੀ ਗਰਮੀਆਂ ਦਾ ਵੇਲਾ", "HEOG": "ਪੱਛਮੀ ਗ੍ਰੀਨਲੈਂਡ ਗਰਮੀਆਂ ਦਾ ਵੇਲਾ", "ACDT": "ਆਸਟ੍ਰੇਲੀਆਈ ਕੇਂਦਰੀ ਪ੍ਰਕਾਸ਼ ਵੇਲਾ", "ChST": "ਚਾਮੋਰੋ ਮਿਆਰੀ ਵੇਲਾ", "ACWST": "ਆਸਟ੍ਰੇਲੀਆਈ ਕੇਂਦਰੀ ਪੱਛਮੀ ਮਿਆਰੀ ਵੇਲਾ", "JDT": "ਜਪਾਨ ਪ੍ਰਕਾਸ਼ ਵੇਲਾ", "AEDT": "ਆਸਟ੍ਰੇਲੀਆਈ ਪੂਰਬੀ ਪ੍ਰਕਾਸ਼ ਵੇਲਾ", "EAT": "ਪੂਰਬੀ ਅਫਰੀਕਾ ਵੇਲਾ", "SAST": "ਦੱਖਣੀ ਅਫ਼ਰੀਕਾ ਮਿਆਰੀ ਵੇਲਾ", "HNT": "ਨਿਊਫਾਉਂਡਲੈਂਡ ਮਿਆਰੀ ਵੇਲਾ", "HECU": "ਕਿਊਬਾ ਪ੍ਰਕਾਸ਼ ਵੇਲਾ", "JST": "ਜਪਾਨ ਮਿਆਰੀ ਵੇਲਾ", "MESZ": "ਮੱਧ ਯੂਰਪੀ ਗਰਮੀਆਂ ਦਾ ਵੇਲਾ", "NZDT": "ਨਿਊਜ਼ੀਲੈਂਡ ਪ੍ਰਕਾਸ਼ ਵੇਲਾ", "HNPM": "ਸੈਂਟ ਪੀਅਰੇ ਅਤੇ ਮਿਕੇਲਨ ਮਿਆਰੀ ਵੇਲਾ", "WIT": "ਪੂਰਬੀ ਇੰਡੋਨੇਸ਼ੀਆ ਵੇਲਾ", "VET": "ਵੈਨੇਜ਼ੂਏਲਾ ਵੇਲਾ", "WITA": "ਮੱਧ ਇੰਡੋਨੇਸ਼ੀਆਈ ਵੇਲਾ", "OEZ": "ਪੂਰਬੀ ਯੂਰਪੀ ਮਿਆਰੀ ਵੇਲਾ", "HNOG": "ਪੱਛਮੀ ਗ੍ਰੀਨਲੈਂਡ ਮਿਆਰੀ ਵੇਲਾ", "WAST": "ਪੱਛਮੀ ਅਫਰੀਕਾ ਗਰਮੀਆਂ ਦਾ ਵੇਲਾ", "HNEG": "ਪੂਰਬੀ ਗ੍ਰੀਨਲੈਂਡ ਮਿਆਰੀ ਵੇਲਾ", "HAT": "ਨਿਊਫਾਉਂਡਲੈਂਡ ਪ੍ਰਕਾਸ਼ ਵੇਲਾ", "MDT": "ਮਕਾਉ ਗਰਮੀ-ਰੁੱਤ ਸਮਾਂ", "CLT": "ਚਿਲੀ ਮਿਆਰੀ ਵੇਲਾ", "CHADT": "ਚੈਥਮ ਪ੍ਰਕਾਸ਼ ਵੇਲਾ", "HKT": "ਹਾਂਗ ਕਾਂਗ ਮਿਆਰੀ ਵੇਲਾ"},
82 // Locale returns the current translators string locale
83 func (pa *pa_Arab) Locale() string {
87 // PluralsCardinal returns the list of cardinal plural rules associated with 'pa_Arab'
88 func (pa *pa_Arab) PluralsCardinal() []locales.PluralRule {
89 return pa.pluralsCardinal
92 // PluralsOrdinal returns the list of ordinal plural rules associated with 'pa_Arab'
93 func (pa *pa_Arab) PluralsOrdinal() []locales.PluralRule {
94 return pa.pluralsOrdinal
97 // PluralsRange returns the list of range plural rules associated with 'pa_Arab'
98 func (pa *pa_Arab) PluralsRange() []locales.PluralRule {
99 return pa.pluralsRange
102 // CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'pa_Arab'
103 func (pa *pa_Arab) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
107 if n >= 0 && n <= 1 {
108 return locales.PluralRuleOne
111 return locales.PluralRuleOther
114 // OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'pa_Arab'
115 func (pa *pa_Arab) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
116 return locales.PluralRuleOther
119 // RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'pa_Arab'
120 func (pa *pa_Arab) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
122 start := pa.CardinalPluralRule(num1, v1)
123 end := pa.CardinalPluralRule(num2, v2)
125 if start == locales.PluralRuleOne && end == locales.PluralRuleOne {
126 return locales.PluralRuleOne
127 } else if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
128 return locales.PluralRuleOther
129 } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
130 return locales.PluralRuleOne
133 return locales.PluralRuleOther
137 // MonthAbbreviated returns the locales abbreviated month given the 'month' provided
138 func (pa *pa_Arab) MonthAbbreviated(month time.Month) string {
139 return pa.monthsAbbreviated[month]
142 // MonthsAbbreviated returns the locales abbreviated months
143 func (pa *pa_Arab) MonthsAbbreviated() []string {
144 return pa.monthsAbbreviated[1:]
147 // MonthNarrow returns the locales narrow month given the 'month' provided
148 func (pa *pa_Arab) MonthNarrow(month time.Month) string {
149 return pa.monthsNarrow[month]
152 // MonthsNarrow returns the locales narrow months
153 func (pa *pa_Arab) MonthsNarrow() []string {
154 return pa.monthsNarrow[1:]
157 // MonthWide returns the locales wide month given the 'month' provided
158 func (pa *pa_Arab) MonthWide(month time.Month) string {
159 return pa.monthsWide[month]
162 // MonthsWide returns the locales wide months
163 func (pa *pa_Arab) MonthsWide() []string {
164 return pa.monthsWide[1:]
167 // WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
168 func (pa *pa_Arab) WeekdayAbbreviated(weekday time.Weekday) string {
169 return pa.daysAbbreviated[weekday]
172 // WeekdaysAbbreviated returns the locales abbreviated weekdays
173 func (pa *pa_Arab) WeekdaysAbbreviated() []string {
174 return pa.daysAbbreviated
177 // WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
178 func (pa *pa_Arab) WeekdayNarrow(weekday time.Weekday) string {
179 return pa.daysNarrow[weekday]
182 // WeekdaysNarrow returns the locales narrow weekdays
183 func (pa *pa_Arab) WeekdaysNarrow() []string {
187 // WeekdayShort returns the locales short weekday given the 'weekday' provided
188 func (pa *pa_Arab) WeekdayShort(weekday time.Weekday) string {
189 return pa.daysShort[weekday]
192 // WeekdaysShort returns the locales short weekdays
193 func (pa *pa_Arab) WeekdaysShort() []string {
197 // WeekdayWide returns the locales wide weekday given the 'weekday' provided
198 func (pa *pa_Arab) WeekdayWide(weekday time.Weekday) string {
199 return pa.daysWide[weekday]
202 // WeekdaysWide returns the locales wide weekdays
203 func (pa *pa_Arab) WeekdaysWide() []string {
207 // Decimal returns the decimal point of number
208 func (pa *pa_Arab) Decimal() string {
212 // Group returns the group of number
213 func (pa *pa_Arab) Group() string {
217 // Group returns the minus sign of number
218 func (pa *pa_Arab) Minus() string {
222 // FmtNumber returns 'num' with digits/precision of 'v' for 'pa_Arab' and handles both Whole and Real numbers based on 'v'
223 func (pa *pa_Arab) FmtNumber(num float64, v uint64) string {
225 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
226 l := len(s) + 5 + 1*len(s[:len(s)-int(v)-1])/3
232 b := make([]byte, 0, l)
234 for i := len(s) - 1; i >= 0; i-- {
237 b = append(b, pa.decimal[0])
244 if count == groupThreshold {
245 b = append(b, pa.group[0])
261 for j := len(pa.minus) - 1; j >= 0; j-- {
262 b = append(b, pa.minus[j])
267 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
268 b[i], b[j] = b[j], b[i]
274 // FmtPercent returns 'num' with digits/precision of 'v' for 'pa_Arab' and handles both Whole and Real numbers based on 'v'
275 // NOTE: 'num' passed into FmtPercent is assumed to be in percent already
276 func (pa *pa_Arab) FmtPercent(num float64, v uint64) string {
277 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
279 b := make([]byte, 0, l)
281 for i := len(s) - 1; i >= 0; i-- {
284 b = append(b, pa.decimal[0])
292 for j := len(pa.minus) - 1; j >= 0; j-- {
293 b = append(b, pa.minus[j])
298 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
299 b[i], b[j] = b[j], b[i]
302 b = append(b, pa.percent...)
307 // FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'pa_Arab'
308 func (pa *pa_Arab) FmtCurrency(num float64, v uint64, currency currency.Type) string {
310 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
311 symbol := pa.currencies[currency]
312 l := len(s) + len(symbol) + 8
314 b := make([]byte, 0, l)
316 for i := len(s) - 1; i >= 0; i-- {
319 b = append(b, pa.decimal[0])
326 for j := len(symbol) - 1; j >= 0; j-- {
327 b = append(b, symbol[j])
330 for j := len(pa.currencyPositivePrefix) - 1; j >= 0; j-- {
331 b = append(b, pa.currencyPositivePrefix[j])
335 for j := len(pa.minus) - 1; j >= 0; j-- {
336 b = append(b, pa.minus[j])
341 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
342 b[i], b[j] = b[j], b[i]
345 b = append(b, pa.currencyPositiveSuffix...)
350 // FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'pa_Arab'
351 // in accounting notation.
352 func (pa *pa_Arab) FmtAccounting(num float64, v uint64, currency currency.Type) string {
354 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
355 symbol := pa.currencies[currency]
356 l := len(s) + len(symbol) + 8
358 b := make([]byte, 0, l)
360 for i := len(s) - 1; i >= 0; i-- {
363 b = append(b, pa.decimal[0])
372 for j := len(symbol) - 1; j >= 0; j-- {
373 b = append(b, symbol[j])
376 for j := len(pa.currencyNegativePrefix) - 1; j >= 0; j-- {
377 b = append(b, pa.currencyNegativePrefix[j])
380 for j := len(pa.minus) - 1; j >= 0; j-- {
381 b = append(b, pa.minus[j])
386 for j := len(symbol) - 1; j >= 0; j-- {
387 b = append(b, symbol[j])
390 for j := len(pa.currencyPositivePrefix) - 1; j >= 0; j-- {
391 b = append(b, pa.currencyPositivePrefix[j])
397 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
398 b[i], b[j] = b[j], b[i]
402 b = append(b, pa.currencyNegativeSuffix...)
405 b = append(b, pa.currencyPositiveSuffix...)
411 // FmtDateShort returns the short date representation of 't' for 'pa_Arab'
412 func (pa *pa_Arab) FmtDateShort(t time.Time) string {
414 b := make([]byte, 0, 32)
420 b = strconv.AppendInt(b, int64(t.Day()), 10)
421 b = append(b, []byte{0x2f}...)
427 b = strconv.AppendInt(b, int64(t.Month()), 10)
429 b = append(b, []byte{0x2f}...)
432 b = strconv.AppendInt(b, int64(t.Year()), 10)
434 b = strconv.AppendInt(b, int64(-t.Year()), 10)
440 // FmtDateMedium returns the medium date representation of 't' for 'pa_Arab'
441 func (pa *pa_Arab) FmtDateMedium(t time.Time) string {
443 b := make([]byte, 0, 32)
445 b = strconv.AppendInt(b, int64(t.Day()), 10)
446 b = append(b, []byte{0x20}...)
447 b = append(b, pa.monthsAbbreviated[t.Month()]...)
448 b = append(b, []byte{0x20}...)
451 b = strconv.AppendInt(b, int64(t.Year()), 10)
453 b = strconv.AppendInt(b, int64(-t.Year()), 10)
459 // FmtDateLong returns the long date representation of 't' for 'pa_Arab'
460 func (pa *pa_Arab) FmtDateLong(t time.Time) string {
462 b := make([]byte, 0, 32)
464 b = strconv.AppendInt(b, int64(t.Day()), 10)
465 b = append(b, []byte{0x20}...)
466 b = append(b, pa.monthsWide[t.Month()]...)
467 b = append(b, []byte{0x20}...)
470 b = strconv.AppendInt(b, int64(t.Year()), 10)
472 b = strconv.AppendInt(b, int64(-t.Year()), 10)
478 // FmtDateFull returns the full date representation of 't' for 'pa_Arab'
479 func (pa *pa_Arab) FmtDateFull(t time.Time) string {
481 b := make([]byte, 0, 32)
483 b = append(b, pa.daysWide[t.Weekday()]...)
484 b = append(b, []byte{0x2c, 0x20}...)
490 b = strconv.AppendInt(b, int64(t.Day()), 10)
491 b = append(b, []byte{0x20}...)
492 b = append(b, pa.monthsWide[t.Month()]...)
493 b = append(b, []byte{0x20}...)
496 b = strconv.AppendInt(b, int64(t.Year()), 10)
498 b = strconv.AppendInt(b, int64(-t.Year()), 10)
504 // FmtTimeShort returns the short time representation of 't' for 'pa_Arab'
505 func (pa *pa_Arab) FmtTimeShort(t time.Time) string {
507 b := make([]byte, 0, 32)
515 b = strconv.AppendInt(b, int64(h), 10)
516 b = append(b, pa.timeSeparator...)
522 b = strconv.AppendInt(b, int64(t.Minute()), 10)
523 b = append(b, []byte{0x20}...)
526 b = append(b, pa.periodsAbbreviated[0]...)
528 b = append(b, pa.periodsAbbreviated[1]...)
534 // FmtTimeMedium returns the medium time representation of 't' for 'pa_Arab'
535 func (pa *pa_Arab) FmtTimeMedium(t time.Time) string {
537 b := make([]byte, 0, 32)
545 b = strconv.AppendInt(b, int64(h), 10)
546 b = append(b, pa.timeSeparator...)
552 b = strconv.AppendInt(b, int64(t.Minute()), 10)
553 b = append(b, pa.timeSeparator...)
559 b = strconv.AppendInt(b, int64(t.Second()), 10)
560 b = append(b, []byte{0x20}...)
563 b = append(b, pa.periodsAbbreviated[0]...)
565 b = append(b, pa.periodsAbbreviated[1]...)
571 // FmtTimeLong returns the long time representation of 't' for 'pa_Arab'
572 func (pa *pa_Arab) FmtTimeLong(t time.Time) string {
574 b := make([]byte, 0, 32)
582 b = strconv.AppendInt(b, int64(h), 10)
583 b = append(b, pa.timeSeparator...)
589 b = strconv.AppendInt(b, int64(t.Minute()), 10)
590 b = append(b, pa.timeSeparator...)
596 b = strconv.AppendInt(b, int64(t.Second()), 10)
597 b = append(b, []byte{0x20}...)
600 b = append(b, pa.periodsAbbreviated[0]...)
602 b = append(b, pa.periodsAbbreviated[1]...)
605 b = append(b, []byte{0x20}...)
613 // FmtTimeFull returns the full time representation of 't' for 'pa_Arab'
614 func (pa *pa_Arab) FmtTimeFull(t time.Time) string {
616 b := make([]byte, 0, 32)
624 b = strconv.AppendInt(b, int64(h), 10)
625 b = append(b, pa.timeSeparator...)
631 b = strconv.AppendInt(b, int64(t.Minute()), 10)
632 b = append(b, pa.timeSeparator...)
638 b = strconv.AppendInt(b, int64(t.Second()), 10)
639 b = append(b, []byte{0x20}...)
642 b = append(b, pa.periodsAbbreviated[0]...)
644 b = append(b, pa.periodsAbbreviated[1]...)
647 b = append(b, []byte{0x20}...)
651 if btz, ok := pa.timezones[tz]; ok {
652 b = append(b, btz...)