File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
app/code/Magento/Quote/Model/Quote/Address Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change 6
6
namespace Magento \Quote \Model \Quote \Address ;
7
7
8
8
/**
9
+ * Class Total
10
+ *
9
11
* @method string getCode()
10
12
*
11
13
* @api
@@ -54,6 +56,8 @@ public function __construct(
54
56
*/
55
57
public function setTotalAmount ($ code , $ amount )
56
58
{
59
+ $ amount = is_float ($ amount ) ? round ($ amount , 4 ) : $ amount ;
60
+
57
61
$ this ->totalAmounts [$ code ] = $ amount ;
58
62
if ($ code != 'subtotal ' ) {
59
63
$ code = $ code . '_amount ' ;
@@ -72,6 +76,8 @@ public function setTotalAmount($code, $amount)
72
76
*/
73
77
public function setBaseTotalAmount ($ code , $ amount )
74
78
{
79
+ $ amount = is_float ($ amount ) ? round ($ amount , 4 ) : $ amount ;
80
+
75
81
$ this ->baseTotalAmounts [$ code ] = $ amount ;
76
82
if ($ code != 'subtotal ' ) {
77
83
$ code = $ code . '_amount ' ;
@@ -167,6 +173,7 @@ public function getAllBaseTotalAmounts()
167
173
168
174
/**
169
175
* Set the full info, which is used to capture tax related information.
176
+ *
170
177
* If a string is used, it is assumed to be serialized.
171
178
*
172
179
* @param array|string $info
You can’t perform that action at this time.
0 commit comments