Skip to content

Commit

Permalink
Merge pull request #5 from mygento/m2-helper-fix
Browse files Browse the repository at this point in the history
M2 helper fix
  • Loading branch information
alexgog78 authored Nov 9, 2017
2 parents 95b8a5a + 7865470 commit 56f27b7
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
16 changes: 16 additions & 0 deletions Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,4 +215,20 @@ public function getUrl($route, $params = [])
{
return $this->_urlBuilder->getUrl($route, $params);
}

/**
* Force convert to float
*
* @param mixed $value
* @return float
*/
public function formatToNumber($value)
{
$value = floatval(str_replace(
[' ', ','],
['', '.'],
$value
));
return $value;
}
}
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "mygento/base",
"type": "magento2-module",
"version": "2.2.2",
"version": "2.2.3",
"license": "OSL-3.0",
"homepage": "https://github.com/mygento/base",
"description": "Mygento Base",
Expand Down
2 changes: 1 addition & 1 deletion etc/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Mygento_Base" setup_version="2.2.2"></module>
<module name="Mygento_Base" setup_version="2.2.3"></module>
</config>

0 comments on commit 56f27b7

Please sign in to comment.