Skip to content

Commit e4becaf

Browse files
Arkadij KuzhelDanGarner
authored andcommitted
AITCORE-4: Update price format in component
* Fix issue: Deprecated Functionality: NumberFormatter::setAttribute(): Passing null to parameter #2 ($value) of type int|float is deprecated in /var/www/html/vendor/magento/module-directory/Model/Currency.php on line 497 * Rearrange imports * Add `@throws` to method annotation * Fix is safe because the method's default `$precision` [appeared in Magento 2.0.0](https://github.com/magento/magento2/blame/0f9a056c8d83c4f319626b3e56ec52a533999f25/lib/internal/Magento/Framework/Pricing/PriceCurrencyInterface.php#L53)
1 parent cfdce78 commit e4becaf

File tree

1 file changed

+5
-3
lines changed
  • Components/Ui/Component/Listing/Column

1 file changed

+5
-3
lines changed

Components/Ui/Component/Listing/Column/Price.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
namespace Aitoc\Core\Components\Ui\Component\Listing\Column;
44

5+
use Magento\Framework\Pricing\PriceCurrencyInterface;
56
use Magento\Framework\View\Element\UiComponent\ContextInterface;
67
use Magento\Framework\View\Element\UiComponentFactory;
7-
use Magento\Ui\Component\Listing\Columns\Column;
8-
use Magento\Framework\Pricing\PriceCurrencyInterface;
98
use Magento\Store\Model\StoreManagerInterface;
9+
use Magento\Ui\Component\Listing\Columns\Column;
1010

1111
class Price extends Column
1212
{
@@ -37,7 +37,9 @@ public function __construct(
3737
* Prepare Data Source
3838
*
3939
* @param array $dataSource
40+
*
4041
* @return array
42+
* @throws \Magento\Framework\Exception\NoSuchEntityException
4143
*/
4244
public function prepareDataSource(array $dataSource)
4345
{
@@ -48,7 +50,7 @@ public function prepareDataSource(array $dataSource)
4850
$item[$this->getData('name')] = $this->priceFormatter->format(
4951
$item[$this->getData('name')],
5052
false,
51-
null,
53+
\Magento\Framework\Pricing\PriceCurrencyInterface::DEFAULT_PRECISION,
5254
null,
5355
$currencyCode
5456
);

0 commit comments

Comments
 (0)