wp_exif_frac2dec

Convert a fraction string to a decimal.

Description

(int|float) wp_exif_frac2dec( (string) $str ); 

Returns (int|float)

Parameters (1)

0. $str (string)
The str.

Usage

  1. if ( !function_exists( 'wp_exif_frac2dec' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/image.php'; 
  3.  
  4. // The str. 
  5. $str = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wp_exif_frac2dec($str); 
  9.  

Defined (1)

The function is defined in the following location(s).

/wp-admin/includes/image.php  
  1. function wp_exif_frac2dec($str) { 
  2. @list( $n, $d ) = explode( '/', $str ); 
  3. if ( !empty($d) ) 
  4. return $n / $d; 
  5. return $str;