Private/Polyfony/Format.php
public static function float($value, int $precision = 2) :float {
		if(strrpos($value, '.')) {
			$value = str_replace(',', '' , $value);
		}
		elseif(strrpos($value, ',')) {
			$value = str_replace('.', '' , $value);
		} 
		return(floatval(
			round(preg_replace('/[^0-9.\-]/', '', str_replace(',', '.' , $value)), $precision)
		));
	}
public static function float($value, int $precision = 2) :float {
		if(strrpos($value, '.')) {
			$value = str_replace(',', '' , $value);
		}
		elseif(strrpos($value, ',')) {
			$value = str_replace('.', '' , $value);
		} 
		return(floatval(
			round(preg_replace('/[^0-9.\-]/', '', str_replace(',', '.' , $value)), $precision)
		));
	}
public static function float ( $ value , int $ precision = 2 ) : float { if ( strrpos ( $ value , '.' ) ) { $ value = str_replace ( ',' , '' , $ value ) ; } elseif ( strrpos ( $ value , ',' ) ) { $ value = str_replace ( '.' , '' , $ value ) ; } return ( floatval ( round ( preg_replace ( '/[^0-9.\-]/' , '' , str_replace ( ',' , '.' , $ value ) ) , $ precision ) ) ) ; }
will clean the value of anything but 0-9\.- preserve sign return float
will clean the value of anything but 0 - 9 \ . - preserve sign return float