public static function decimal($input, $places = 2) {
        if (!$places) {
            $regex = '/^[-+]?[0-9]*\.{1}[0-9]+(?:[eE][-+]?[0-9]+)?$/';
        } else {
            $regex = '/^[-+]?[0-9]*\.{1}[0-9]{' . $places . '}$/';
        }

        return static::custom($input, $regex);
    }
public static function decimal($input, $places = 2) {
        if (!$places) {
            $regex = '/^[-+]?[0-9]*\.{1}[0-9]+(?:[eE][-+]?[0-9]+)?$/';
        } else {
            $regex = '/^[-+]?[0-9]*\.{1}[0-9]{' . $places . '}$/';
        }

        return static::custom($input, $regex);
    }
public static function decimal ( $ input , $ places = 2 ) { if ( ! $ places ) { $ regex = '/^[-+]?[0-9]*\.{1}[0-9]+(?:[eE][-+]?[0-9]+)?$/' ; } else { $ regex = '/^[-+]?[0-9]*\.{1}[0-9]{' . $ places . '}$/' ; } return static :: custom ( $ input , $ regex ) ; }
Validate input is a decimal.

@param string $input
@param int $places
@return bool
Validate input is a decimal .