File modules/dsl/standard/NumberInstance.class.php

Last commit: Tue Jul 19 00:10:00 2022 +0200	Jan Dankert	New: Scripting language: Ignore Keyword "new"; Support for Calling object constructors; Splitting objects into an instance and a wrapper.
1 <?php 2 3 4 namespace dsl\standard; 5 6 7 use dsl\context\BaseScriptableObject; 8 9 class NumberInstance extends BaseScriptableObject 10 { 11 private $value; 12 13 /** 14 * Number constructor. 15 * @param $value 16 */ 17 public function __construct($value=null) 18 { 19 $this->value = $value; 20 } 21 22 public function __toString() 23 { 24 return "" . $this->value; 25 } 26 27 28 public function toFixed( $digits ) 29 { 30 return number_format($this->value,$digits); 31 } 32 33 public function toNumber() { 34 return $this->value; 35 } 36 37 }
Download modules/dsl/standard/NumberInstance.class.php
History Tue, 19 Jul 2022 00:10:00 +0200 Jan Dankert New: Scripting language: Ignore Keyword "new"; Support for Calling object constructors; Splitting objects into an instance and a wrapper.