IntExtesion extension

Money, counts, time and month-name helpers on ints. 1500000.toman()

on

Properties

gregorianMonthName → String

Available on int, provided by the IntExtesion extension

Short English month name for 1-12. 1 → "Jan"
no setter
jalaliMonthName → String

Available on int, provided by the IntExtesion extension

Jalali month name for 1-12. 1 → "فروردین"
no setter
twoDigits → String

Available on int, provided by the IntExtesion extension

Zero-padded to 2 digits. 5 → "05"
no setter

Methods

getMonthName(bool isJalali) → String

Available on int, provided by the IntExtesion extension

Month name: Jalali when isJalali, else short English. 1.getMonthName(true) → "فروردین"
rial({bool removeNegative = false}) → String

Available on int, provided by the IntExtesion extension

1500000 → "1,500,000 ریال"; removeNegative drops the minus sign.
rialToToman({bool removeNegative = false}) → String

Available on int, provided by the IntExtesion extension

Rial → toman (÷10). 150000 → "15,000 تومان"
secondsToTimeLeft() → String

Available on int, provided by the IntExtesion extension

Seconds → countdown text. 75 → "01:15", 3725 → "01:02:05", 9 → "09"
separate3By3({bool removeNegative = false}) → String

Available on int, provided by the IntExtesion extension

1500000 → "1,500,000"; removeNegative drops the minus sign.
subtractClamping(int subtract, {int minValue = 0, int maxValue = 999999999}) → int

Available on int, provided by the IntExtesion extension

Subtracts and clamps between minValue and maxValue. stock.subtractClamping(5)
toDateTime({bool isUtc = false}) → DateTime

Available on int, provided by the IntExtesion extension

Milliseconds since 1970 → DateTime. 1700000000000.toDateTime()
toKMB() → String

Available on int, provided by the IntExtesion extension

Short count. 1500 → "1.5 K", 2300000 → "2.3 M"
toman({bool removeNegative = false}) → String

Available on int, provided by the IntExtesion extension

1500000 → "1,500,000 تومان"; removeNegative drops the minus sign.