A WordPress-centric search engine for devs and theme authors



wp_exif_frac2dec ›

Since2.5.0
Deprecatedn/a
wp_exif_frac2dec ( $str )
Parameters:
  • (string) $str
    Required: Yes
Returns:
  • (int|float)
Defined at:
Codex:

Convert a fraction string to a decimal.



Source

function wp_exif_frac2dec( $str ) {
	if ( false === strpos( $str, '/' ) ) {
		return $str;
	}

	list( $numerator, $denominator ) = explode( '/', $str );
	if ( ! empty( $denominator ) ) {
		return $numerator / $denominator;
	}
	return $str;
}