class FormatUtils

Class FormatUtils

Various format utility functions

Constants

CURRENCY_USD

Methods

static string
formatPrice(integer|float $number, string $currency = self::CURRENCY_USD)

Format a price to two decimals

static string
formatPercentage(integer|float $number)

Format a number into a percentage with two decimals

Details

at line line 25
static string formatPrice(integer|float $number, string $currency = self::CURRENCY_USD)

Format a price to two decimals

Parameters

integer|float $number
string $currency

Return Value

string

at line line 37
static string formatPercentage(integer|float $number)

Format a number into a percentage with two decimals

Parameters

integer|float $number

Return Value

string