public static formatAmount ( integer $amount ) : string | ||
$amount | integer | |
return | string |
public static function formatAmount($amount)
{
if (static::$formatCurrencyUsing) {
return call_user_func(static::$formatCurrencyUsing, $amount);
}
$amount = number_format($amount, 2);
if (starts_with($amount, '-')) {
return '-' . static::usesCurrencySymbol() . ltrim($amount, '-');
} else {
return static::usesCurrencySymbol() . $amount;
}
}
/** * Format the given amount into a string based on the user's preferences. * * @param int $amount * @return string */ protected function formatAmount($amount) { return Cashier::formatAmount($amount); }