We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f8022f8 commit 53aff60Copy full SHA for 53aff60
app/code/Magento/Catalog/Pricing/Render/PriceBox.php
@@ -102,10 +102,16 @@ public function getCanDisplayQty(Product $product)
102
* Format percent
103
*
104
* @param float $percent
105
+ *
106
* @return string
107
*/
108
public function formatPercent(float $percent): string
109
{
- return rtrim(number_format($percent, 2), '.0');
110
+ /*First rtrim - trim zeros. So, 10.00 -> 10.*/
111
+ /*Second rtrim - trim dot. So, 10. -> 10*/
112
+ return rtrim(
113
+ rtrim(number_format($percent, 2), '0'),
114
+ '.'
115
+ );
116
}
117
0 commit comments