mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
31 lines
559 B
PHP
31 lines
559 B
PHP
|
<?php
|
||
|
|
||
|
namespace FireflyIII\Helpers\Csv\Converter;
|
||
|
|
||
|
use FireflyIII\Models\Account;
|
||
|
|
||
|
/**
|
||
|
* Class AmountComma
|
||
|
*
|
||
|
* Parses the input as the amount with a comma as decimal separator
|
||
|
*
|
||
|
* @package FireflyIII\Helpers\Csv\Converter
|
||
|
*/
|
||
|
class AmountComma extends BasicConverter implements ConverterInterface
|
||
|
{
|
||
|
|
||
|
/**
|
||
|
* @return Account|null
|
||
|
*/
|
||
|
public function convert()
|
||
|
{
|
||
|
$value = str_replace(",", ".", $this->value );
|
||
|
|
||
|
if (is_numeric($value)) {
|
||
|
return floatval($value);
|
||
|
}
|
||
|
|
||
|
return 0;
|
||
|
}
|
||
|
}
|