<?php
namespace WPIS;

class DecimalFilter {
    public static function transform( $value ){
        $buffer = 0;

        if( $value !== '' && $value !== '0' ){
            $buffer = number_format(floatval($value), 2, ',', '.');
        }

        $split = explode(',', $buffer);
        if( isset($split[1]) && $split[1] === '00' ){
            $buffer = $split[0];
        }

        return $buffer;
    }
}