public static function currency( $value, $decimals = 2, $currencyCode = null )
	{
		$app = Application::instance();
		$currencyCode = $currencyCode ?: $app->getConfig('app.settings.currency');

		$nf = new \NumberFormatter(\Locale::getDefault(), \NumberFormatter::CURRENCY);
		$nf->setAttribute(\NumberFormatter::MAX_FRACTION_DIGITS, $decimals);
		return $nf->formatCurrency($value, $currencyCode);
	}
public static function currency( $value, $decimals = 2, $currencyCode = null )
	{
		$app = Application::instance();
		$currencyCode = $currencyCode ?: $app->getConfig('app.settings.currency');

		$nf = new \NumberFormatter(\Locale::getDefault(), \NumberFormatter::CURRENCY);
		$nf->setAttribute(\NumberFormatter::MAX_FRACTION_DIGITS, $decimals);
		return $nf->formatCurrency($value, $currencyCode);
	}
public static function currency ( $ value , $ decimals = 2 , $ currencyCode = null ) { $ app = Application :: instance ( ) ; $ currencyCode = $ currencyCode ? : $ app -> getConfig ( 'app.settings.currency' ) ; $ nf = new \ NumberFormatter ( \ Locale :: getDefault ( ) , \ NumberFormatter :: CURRENCY ) ; $ nf -> setAttribute ( \ NumberFormatter :: MAX_FRACTION_DIGITS , $ decimals ) ; return $ nf -> formatCurrency ( $ value , $ currencyCode ) ; }
returns a string with currency formatted accordingly to locale settings
@param string $value
@param string $decimals
@param string $currencyCode
@return string
returns a string with currency formatted accordingly to locale settings