Bitrate.php
22 lines
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace AC\Formatter\Media\Audio; |
| 6 | |
| 7 | use AC\Formatter; |
| 8 | use AC\Type\Value; |
| 9 | |
| 10 | class Bitrate implements Formatter |
| 11 | { |
| 12 | public function format(Value $value): Value |
| 13 | { |
| 14 | return $value->get_value() > 1000 |
| 15 | ? $value->with_value( |
| 16 | sprintf('%s %s', number_format($value->get_value() / 1000), __('Kbps', 'codepress-admin-columns')) |
| 17 | ) |
| 18 | : $value; |
| 19 | } |
| 20 | |
| 21 | } |
| 22 |