Adding a useful mathematical shortcut.

This commit is contained in:
defacer
2005-02-02 02:22:56 +00:00
parent ac1d9a2212
commit 1319096389
+11
View File
@@ -4980,5 +4980,16 @@ function message_popup_window() {
return '';
}
// Used to make sure that $min <= $value <= $max
function bounded_number($min, $value, $max) {
if($value < $min) {
return $min;
}
if($value > $max) {
return $max;
}
return $value;
}
// vim:autoindent:expandtab:shiftwidth=4:tabstop=4:tw=140:
?>