function format_number_compute_boundary in Format Number API 7
Same name and namespace in other branches
- 6 format_number.module \format_number_compute_boundary()
Compute the lower or upper bounds of a number.
Parameters
$direction: 'lower' to compute the minimum possible value. 'upper' to compute the maximum possible value.
$precision: Integer that indicates the total number of digits available to store the number, including the digits to the right of the decimal point.
$decimals: Integer that indicates the number of available digits to the right of the decimal point.
Return value
The minimum or maximum possible value.
2 calls to format_number_compute_boundary()
- format_number_numericfield_process in ./
format_number.module - Process an individual numeric form element.
- format_number_numericfield_validate in ./
format_number.module - Validation of an individual numeric form element.
File
- ./
format_number.module, line 403 - This module provides a method to configure number formats (site default and user defined) with configurable decimal point and thousand separators. It also exposes several functions that can be used by other contributed or custom modules to display…
Code
function format_number_compute_boundary($direction, $precision = 0, $decimals = 0) {
return (double) (($direction == 'lower' ? '-' : '') . str_repeat('9', $precision - $decimals) . '.' . str_repeat('9', $decimals));
}