| 1 | <?php |
||
| 18 | class NumberValue extends AbstractValue |
||
| 19 | { |
||
| 20 | /** |
||
| 21 | * @var float |
||
| 22 | */ |
||
| 23 | private $number; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @var string |
||
| 27 | */ |
||
| 28 | private $unit; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @inheritdoc |
||
| 32 | */ |
||
| 33 | 35 | public function getCompiled() |
|
| 34 | { |
||
| 35 | 35 | $num = $this->number; |
|
| 36 | 35 | if (isset($this->options['numberPrecision'])) { |
|
| 37 | $num = round($num, $this->options['numberPrecision']); |
||
| 38 | } |
||
| 39 | |||
| 40 | 35 | return $num . $this->unit; |
|
| 41 | } |
||
| 42 | |||
| 43 | /** |
||
| 44 | * @inheritdoc |
||
| 45 | */ |
||
| 46 | 35 | public function initializeFromOldFormat(array $value) |
|
| 51 | } |
||
| 52 |