WordPress at Your Fingertips
function is not described

wp_exif_frac2dec() WP 2.5.0

Convert a fraction string to a decimal.

No Hooks.

Return

Int|float.

Usage

wp_exif_frac2dec( $str );
$str(string) (required)
-

Changelog

Since 2.5.0 Introduced.

Code of wp_exif_frac2dec() WP 5.8.2

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

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