diff --git a/modules/data.eval.inc b/modules/data.eval.inc index 2097ae5..2ea67cf 100644 --- a/modules/data.eval.inc +++ b/modules/data.eval.inc @@ -184,11 +184,6 @@ function rules_action_data_convert($arguments, RulesPlugin $element, $state) { $from_type = $value_info['type']; $target_type = $arguments['type']; - // First apply the rounding behavior if given. - if (isset($arguments['rounding_behavior'])) { - $arguments['value'] = round($arguments['value'], 0, $arguments['rounding_behavior']); - } - switch ($target_type) { case 'decimal': $result = floatval($arguments['value']); @@ -212,11 +207,6 @@ function rules_action_data_convert_info_alter(&$element_info, RulesAbstractPlugi if (isset($element->settings['type']) && $type = $element->settings['type']) { $element_info['provides']['conversion_result']['type'] = $type; - if ($type != 'integer') { - // Only support the rounding behavior option for integers. - unset($element_info['parameter']['rounding_behavior']); - } - // Configure compatible source-types: switch ($type) { case 'integer': diff --git a/modules/data.rules.inc b/modules/data.rules.inc index 02e91c1..6ffc8a0 100644 --- a/modules/data.rules.inc +++ b/modules/data.rules.inc @@ -207,16 +207,6 @@ function rules_data_action_info() { 'label' => t('Value to convert'), 'default mode' => 'selector', ), - // For to-integer conversion only. - 'rounding_behavior' => array( - 'type' => 'token', - 'label' => t('Rounding behavior'), - 'description' => t('The rounding behavior the conversion should use.'), - 'options list' => 'rules_action_data_convert_rounding_behavior_options', - 'restriction' => 'input', - 'default value' => PHP_ROUND_HALF_DOWN, - 'optional' => TRUE, - ), ), 'provides' => array( 'conversion_result' => array( @@ -246,18 +236,6 @@ function rules_action_data_convert_types_options(RulesPlugin $element, $param_na } /** - * Data conversation action: Options list callback for rounding behavior. - */ -function rules_action_data_convert_rounding_behavior_options(RulesPlugin $element, $param_name) { - return array( - PHP_ROUND_HALF_UP => t('Round half up (9.5 -> 10)'), - PHP_ROUND_HALF_DOWN => t('Round half down (9.5 -> 9)'), - PHP_ROUND_HALF_EVEN => t('Round half even (9.5 -> 10)'), - PHP_ROUND_HALF_ODD => t('Round half odd (9.5 -> 9)'), - ); -} - -/** * Customize access check for data set action. */ function rules_action_data_set_access(RulesAbstractPlugin $element) {