5 class Number extends \Rsi\Fred\Controller\Widget{
15 return array_merge(parent::clientConfig(),[
16 self::MIN => $this->min || $this->
nothing($this->min) ? $this->min :
'0.0',
17 self::MAX => $this->max || $this->
nothing($this->max) ? $this->max :
'0.0',
18 self::DECIMALS => $this->decimals,
19 self::ROUND => $this->
round,
20 self::TRIM => $this->trim
25 if($value === null)
return null;
26 $value =
round($value,$this->decimals);
31 return \Rsi::nothing($value) ? null : $this->
round($this->local->convertNumber($value,$this->decimals));
35 return $this->local->formatNumber($this->
round($value),$this->decimals,
$trim ? $this->trim : null);
39 return preg_match(
'/^-?\\d+(\\.\\d+)?$/',$value);
43 return $this->
config(self::DECIMALS) ?: ($this->
round ? max(0,(
int)ceil(-log10($this->
round))) : null);