diff --git a/includes/CargoFieldDescription.php b/includes/CargoFieldDescription.php index 000458e0..cc320f95 100644 --- a/includes/CargoFieldDescription.php +++ b/includes/CargoFieldDescription.php @@ -324,16 +324,12 @@ public function prepareAndValidateValue( $fieldValue ) { } $individualValues = explode( $delimiter, $fieldValue ); foreach ( $individualValues as &$individualValue ) { - if ( !is_int( $individualValue ) ) { - $individualValue = round( $individualValue ); - } + $individualValue = round( floatval( $individualValue ) ); } $newValue = implode( $delimiter, $individualValues ); } else { $newValue = str_replace( $wgCargoDigitGroupingCharacter, '', $fieldValue ); - if ( !is_int( $newValue ) ) { - $newValue = round( $newValue ); - } + $newValue = round( floatval( $newValue ) ); } } elseif ( $fieldType == 'Float' || $fieldType == 'Rating' ) { // Remove digit-grouping character, and change