diff --git a/includes/wc-formatting-functions.php b/includes/wc-formatting-functions.php index 683325ebf82..ddb326b5d3d 100644 --- a/includes/wc-formatting-functions.php +++ b/includes/wc-formatting-functions.php @@ -165,6 +165,7 @@ function wc_get_dimension( $dimension, $to_unit, $from_unit = '' ) { * @return float */ function wc_get_weight( $weight, $to_unit, $from_unit = '' ) { + $weight = (float) $weight; $to_unit = strtolower( $to_unit ); if ( empty( $from_unit ) ) {