LLMS_Admin_Review::round_down( int $number )

Round a number down to a big-ish round number


Description Description


Parameters Parameters

$number

(int) (Required) Input number.


Top ↑

Return Return

(int)


Top ↑

Source Source

File: includes/admin/class-llms-admin-review.php

	public static function round_down( $number ) {

		if ( $number < 10 ) {
			return $number;
		}

		if ( $number < 100 ) {
			$number = floor( $number / 10 ) * 10;
		} elseif ( $number < 1000 ) {
			$number = floor( $number / 100 ) * 100;
		} elseif ( $number < 10000 ) {
			$number = floor( $number / 1000 ) * 1000;
		} else {
			$number = 10000;
		}

		return $number;

	}

Top ↑

Changelog Changelog

Changelog
Version Description
4.14.0 Numbers less than 10 are not rounded & numbers less than 100 are rounded to the nearest 10.
3.24.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

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