firefly-iii/app/Helpers/Csv/Converter/AmountComma.php

29 lines
516 B
PHP
Raw Normal View History

<?php
namespace FireflyIII\Helpers\Csv\Converter;
/**
* 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
{
/**
2016-01-19 01:48:38 -06:00
* @return float|int
*/
public function convert()
{
$value = str_replace(',', '.', $this->value);
if (is_numeric($value)) {
return floatval($value);
}
2016-02-05 02:25:15 -06:00
return '0';
}
}