W3cubDocs

/WordPress

wp_exif_frac2dec( string $str )

Convert a fraction string to a decimal.

Description

Parameters

$str

(string) (Required)

Return

(int|float)

Source

File: wp-admin/includes/image.php

function wp_exif_frac2dec( $str ) {
	@list( $n, $d ) = explode( '/', $str );
	if ( ! empty( $d ) ) {
		return $n / $d;
	}
	return $str;
}

Changelog

Version Description
2.5.0 Introduced.

© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_exif_frac2dec