<?php

namespace FiloBlu\Flow\Model\Parser\Filters;

/**
 * Class Decimal
 * @package FiloBlu\Flow\Model\Parser\Filters
 */
class Decimal extends AbstractFilter
{
    /**
     * @param $value
     * @param $args
     * @return string
     */
    public function filter($value, $args)
    {
        if (isset($args['length'])) {
            return number_format($value, $args['length'], '.', '');
        }

        return $value;
    }
}
