public function format($decimals = 2, $point = '.', $thousands_sep = ',', $currency = null) {

		if(false === ('-' . intval($decimals) == '-' . $decimals)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type integer, "%s" given', __METHOD__, gettype($decimals)), E_USER_ERROR);
		}

		if(false === is_string($point)) {
			return trigger_error(sprintf('Argument 2 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($point)), E_USER_ERROR);
		}

		if(false === is_string($thousands_sep)) {
			return trigger_error(sprintf('Argument 3 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($thousands_sep)), E_USER_ERROR);
		}

		if(null !== $currency && false === is_string($currency)) {
			return trigger_error(sprintf('Argument 4 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($currency)), E_USER_ERROR);
		}

		return $this -> convert(function($number, $decimals, $point, $thousands_sep, $currency) {
			return ($currency ?: $currency) . number_format($number, $decimals, $point, $thousands_sep);
		}, [$decimals, $point, $thousands_sep, $currency]);
	}
public function format($decimals = 2, $point = '.', $thousands_sep = ',', $currency = null) {

		if(false === ('-' . intval($decimals) == '-' . $decimals)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type integer, "%s" given', __METHOD__, gettype($decimals)), E_USER_ERROR);
		}

		if(false === is_string($point)) {
			return trigger_error(sprintf('Argument 2 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($point)), E_USER_ERROR);
		}

		if(false === is_string($thousands_sep)) {
			return trigger_error(sprintf('Argument 3 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($thousands_sep)), E_USER_ERROR);
		}

		if(null !== $currency && false === is_string($currency)) {
			return trigger_error(sprintf('Argument 4 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($currency)), E_USER_ERROR);
		}

		return $this -> convert(function($number, $decimals, $point, $thousands_sep, $currency) {
			return ($currency ?: $currency) . number_format($number, $decimals, $point, $thousands_sep);
		}, [$decimals, $point, $thousands_sep, $currency]);
	}
public function format ( $ decimals = 2 , $ point = '.' , $ thousands_sep = ',' , $ currency = null ) { if ( false === ( '-' . intval ( $ decimals ) == '-' . $ decimals ) ) { return trigger_error ( sprintf ( 'Argument 1 passed to %s() must be of the type integer, "%s" given' , __METHOD__ , gettype ( $ decimals ) ) , E_USER_ERROR ) ; } if ( false === is_string ( $ point ) ) { return trigger_error ( sprintf ( 'Argument 2 passed to %s() must be of the type string, "%s" given' , __METHOD__ , gettype ( $ point ) ) , E_USER_ERROR ) ; } if ( false === is_string ( $ thousands_sep ) ) { return trigger_error ( sprintf ( 'Argument 3 passed to %s() must be of the type string, "%s" given' , __METHOD__ , gettype ( $ thousands_sep ) ) , E_USER_ERROR ) ; } if ( null !== $ currency && false === is_string ( $ currency ) ) { return trigger_error ( sprintf ( 'Argument 4 passed to %s() must be of the type string, "%s" given' , __METHOD__ , gettype ( $ currency ) ) , E_USER_ERROR ) ; } return $ this -> convert ( function ( $ number , $ decimals , $ point , $ thousands_sep , $ currency ) { return ( $ currency ? : $ currency ) . number_format ( $ number , $ decimals , $ point , $ thousands_sep ) ; } , [ $ decimals , $ point , $ thousands_sep , $ currency ] ) ; }
Converts all the numbers in a string to a specific format
@param int $decimals
@param string $point
@param string $thousands_sep
@param string $currency
@return sFire\Number\Number
Converts all the numbers in a string to a specific format