src/TitaPHP/Helpers/NumberFormatter.php
public static function decimal( $value, $decimals = 2 )
	{
		$nf = new \NumberFormatter(\Locale::getDefault(), \NumberFormatter::DECIMAL);
		$nf->setAttribute(\NumberFormatter::MAX_FRACTION_DIGITS, $decimals);
		return $nf->format($value);
	}
public static function decimal( $value, $decimals = 2 )
	{
		$nf = new \NumberFormatter(\Locale::getDefault(), \NumberFormatter::DECIMAL);
		$nf->setAttribute(\NumberFormatter::MAX_FRACTION_DIGITS, $decimals);
		return $nf->format($value);
	}
public static function decimal ( $ value , $ decimals = 2 ) { $ nf = new \ NumberFormatter ( \ Locale :: getDefault ( ) , \ NumberFormatter :: DECIMAL ) ; $ nf -> setAttribute ( \ NumberFormatter :: MAX_FRACTION_DIGITS , $ decimals ) ; return $ nf -> format ( $ value ) ; }
returns a string with decimal formatted accordingly to locale settings
@param string $value
@param string $decimals
@return string
returns a string with decimal formatted accordingly to locale settings