getid3_lib::trunc

Advertisement

Summery Summery

Truncates a floating-point number at the decimal point.

Syntax Syntax

getid3_lib::trunc( float $floatnumber )

Parameters Parameters

$floatnumber

(float) (Required)

Return Return

(float|int) returns int (if possible, otherwise float)

Source Source

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

	public static function trunc($floatnumber) {
		if ($floatnumber >= 1) {
			$truncatednumber = floor($floatnumber);
		} elseif ($floatnumber <= -1) {
			$truncatednumber = ceil($floatnumber);
		} else {
			$truncatednumber = 0;
		}
		if (self::intValueSupported($truncatednumber)) {
			$truncatednumber = (int) $truncatednumber;
		}
		return $truncatednumber;
	}

Advertisement

Advertisement

Leave a Reply

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