SilverCommerce\TaxAdmin\Helpers\MathsHelper
Simple helper class to provide generic functions to help with maths functions
Synopsis
class MathsHelper
{
- // constants
- const ROUND_DEFAULT = 1;
- const ROUND_UP = 2;
- const ROUND_DOWN = 3;
- // members
- private static $default_round = self::ROUND_DEFAULT;
- // methods
- public static float round_up()
- public static float round_down()
- public static float round()
Hierarchy
Uses
- SilverStripe\Core\Injector\Injectable
- SilverStripe\Core\Config\Configurable
Constants
Name | Value |
---|---|
ROUND_DEFAULT | 1 |
ROUND_UP | 2 |
ROUND_DOWN | 3 |
Members
private
-
$default_round
The default rounding used by this class
Methods
public
- round() — Round the provided value to the defined number of places in the direction provided (up or down).
- round_down() — Rounds up a float to a specified number of decimal places (basically acts like ceil() but allows for decimal places)
- round_up() — Rounds up a float to a specified number of decimal places (basically acts like ceil() but allows for decimal places)