wp_exif_frac2dec( string $str )

Convert a fraction string to a decimal.


Description Description


Parameters Parameters

$str

(string) (Required)


Top ↑

Return Return

(int|float)


Top ↑

Source Source

File: wp-admin/includes/image.php

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

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

Top ↑

Changelog Changelog

Changelog
Version Description
2.5.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.