Pharaonic
Loading...

# ReadableNumber

This is a function that helps to format the numbers.

1// ReadableNumber (int $number, string $delimiter = ',')
2 
3echo ReadableNumber(1020304050607080);
4// Return : 1,020,304,050,607,080

# ReadableNumberToString

This is a function that helps to convert number into string.
Required: PHP Extension intl.

1// ReadableNumberToString ($input, string $lang = 'en')
2 
3echo ReadableNumberToString(7721);
4// Return : seven thousand and seven hundred and twenty-one

# ReadableHumanNumber

This is a function that helps to format the numbers into human-readable format.

1// ReadableHumanNumber (int $number, bool $showDecimal = false, int $decimals = 0)
2 
3echo ReadableHumanNumber(77421);
4// Return : 77K

# ReadableDecimal

This is a function that helps to format the number with decimals.

1// ReadableDecimal ($number, int $decimals = 2, , string $point = '.', string $delimiter = ',')
2 
3echo ReadableDecimal(60708.54);
4// Return : 60,708.54

# ReadableDecInt

This is a function that helps to format the number with decimals and covert it to integer if the decimal number is zero.

1// ReadableDecInt ($number, int $decimals = 2, , string $point = '.', string $delimiter = ',')
2 
3echo ReadableDecInt(70.00);
4// Return : 70

# ReadableSize

This is a function that helps to convert bytes into human-readable size.

1// ReadableSize (int $bytes, bool $decimal = true)
2 
3echo ReadableSize(1000000000);
4// Return : 8 GB