Restore formatting but without rounding for backward compat.

This commit is contained in:
vedanshujain 2021-05-07 14:58:52 +05:30
parent 18411d2b3b
commit b487e363ce
1 changed files with 4 additions and 4 deletions

View File

@ -430,7 +430,7 @@ class WC_Cart extends WC_Legacy_Cart {
* @param string $value Value to set. * @param string $value Value to set.
*/ */
public function set_subtotal( $value ) { public function set_subtotal( $value ) {
$this->totals['subtotal'] = $value; $this->totals['subtotal'] = wc_format_decimal( $value );
} }
/** /**
@ -470,7 +470,7 @@ class WC_Cart extends WC_Legacy_Cart {
* @param string $value Value to set. * @param string $value Value to set.
*/ */
public function set_shipping_total( $value ) { public function set_shipping_total( $value ) {
$this->totals['shipping_total'] = $value; $this->totals['shipping_total'] = wc_format_decimal( $value );
} }
/** /**
@ -490,7 +490,7 @@ class WC_Cart extends WC_Legacy_Cart {
* @param string $value Value to set. * @param string $value Value to set.
*/ */
public function set_cart_contents_total( $value ) { public function set_cart_contents_total( $value ) {
$this->totals['cart_contents_total'] = $value; $this->totals['cart_contents_total'] = wc_format_decimal( $value );
} }
/** /**
@ -531,7 +531,7 @@ class WC_Cart extends WC_Legacy_Cart {
* @param string $value Value to set. * @param string $value Value to set.
*/ */
public function set_fee_total( $value ) { public function set_fee_total( $value ) {
$this->totals['fee_total'] = $value; $this->totals['fee_total'] = wc_format_decimal( $value );
} }
/** /**