getid3_lib::CastAsInt

Advertisement

Syntax Syntax

getid3_lib::CastAsInt( int|float $floatnum )

Parameters Parameters

$floatnum

(int|float) (Required)

Return Return

(int|float)

Source Source

File: wp-includes/ID3/getid3.lib.php

	public static function CastAsInt($floatnum) {
		// convert to float if not already
		$floatnum = (float) $floatnum;

		// convert a float to type int, only if possible
		if (self::trunc($floatnum) == $floatnum) {
			// it's not floating point
			if (self::intValueSupported($floatnum)) {
				// it's within int range
				$floatnum = (int) $floatnum;
			}
		}
		return $floatnum;
	}

Advertisement

Advertisement

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.