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
Filter
Sprintf.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Framework\Filter
;
7
8
class
Sprintf
implements
\Zend_Filter_Interface
9
{
13
protected
$format
;
14
18
protected
$decimals
;
19
23
protected
$decPoint
;
24
28
protected
$thousandsSep
;
29
36
public
function
__construct
(
$format
,
$decimals
=
null
,
$decPoint
=
'.'
,
$thousandsSep
=
','
)
37
{
38
$this->format =
$format
;
39
$this->decimals =
$decimals
;
40
$this->decPoint =
$decPoint
;
41
$this->thousandsSep =
$thousandsSep
;
42
}
43
48
public
function
filter
(
$value
)
49
{
50
if
(
null
!== $this->decimals) {
51
$value
= number_format(
$value
, $this->decimals, $this->decPoint, $this->thousandsSep);
52
}
53
$value
= sprintf($this->format,
$value
);
54
return
$value
;
55
}
56
}
Magento\Framework\Filter\Sprintf\$thousandsSep
$thousandsSep
Definition:
Sprintf.php:28
Magento\Framework\Filter\Sprintf
Definition:
Sprintf.php:8
Magento\Framework\Filter
Definition:
AbstractFactory.php:6
Magento\Framework\Filter\Sprintf\$decPoint
$decPoint
Definition:
Sprintf.php:23
$value
$value
Definition:
gender.phtml:16
Zend_Filter_Interface
Definition:
Interface.php:30
Magento\Framework\Filter\Sprintf\$decimals
$decimals
Definition:
Sprintf.php:18
Magento\Framework\Filter\Sprintf\$format
$format
Definition:
Sprintf.php:13
Magento\Framework\Filter\Sprintf\__construct
__construct($format, $decimals=null, $decPoint='.', $thousandsSep=',')
Definition:
Sprintf.php:36
Magento\Framework\Filter\Sprintf\filter
filter($value)
Definition:
Sprintf.php:48