| @@ -42,9 +42,9 @@ | ||
| 42 | 42 | if ( ! function_exists( 'tptParsePlainText' ) ) { |
| 43 | 43 | function tptParsePlainText( $text, $quantity, $discount = null, $price = null, $base_unit_name = null ) { |
| 44 | 44 | return strtr( $text, array( |
| 45 | 45 | '{tp_quantity}' => $quantity, |
| 46 | - '{tp_discount}' => $discount, | |
| 46 | + '{tp_discount}' => ! is_null( $discount ) ? round( (float) $discount, \TierPricingTable\PricingTable::discountDecimals( (float) $discount ) ) : $discount, | |
| 47 | 47 | '{tp_rounded_discount}' => ! is_null( $discount ) ? round( $discount ) : 0, |
| 48 | 48 | '{tp_price}' => $price ? wc_price( $price ) : '', |
| 49 | 49 | '{tp_base_unit_name}' => $base_unit_name, |
| 50 | 50 | ) ); |