Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
framework
Convert
DataSize.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Framework\Convert
;
8
12
class
DataSize
13
{
21
public
function
convertSizeToBytes
($size)
22
{
23
if
(!is_numeric($size)) {
24
$type
= strtoupper(substr($size, -1));
25
$size = (int)$size;
26
27
switch
(
$type
) {
28
case
'K'
:
29
$size *= 1024;
30
break
;
31
32
case
'M'
:
33
$size *= 1024 * 1024;
34
break
;
35
36
case
'G'
:
37
$size *= 1024 * 1024 * 1024;
38
break
;
39
40
default
:
41
break
;
42
}
43
}
44
return
(
int
)$size;
45
}
46
}
Magento\Framework\Convert\DataSize
Definition:
DataSize.php:12
$type
$type
Definition:
item.phtml:13
Magento\Framework\Convert
Definition:
ConvertArray.php:7
Magento\Framework\Convert\DataSize\convertSizeToBytes
convertSizeToBytes($size)
Definition:
DataSize.php:21