X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=WEB-INF%2Flib%2Fform%2FFloatField.class.php;h=cb035c7c3f12f420b1c8bcc4e4194db597db3722;hb=6c7a98f61e74aeae700b523729abb49ff19d3704;hp=298e09bbe02799936544315f9df40b203b23376b;hpb=6e59f47d1baf9e3d420b4a368dcc005d54b6e599;p=timetracker.git diff --git a/WEB-INF/lib/form/FloatField.class.php b/WEB-INF/lib/form/FloatField.class.php index 298e09bb..cb035c7c 100644 --- a/WEB-INF/lib/form/FloatField.class.php +++ b/WEB-INF/lib/form/FloatField.class.php @@ -29,17 +29,18 @@ import('form.TextField'); class FloatField extends TextField { - var $mDelimiter = '.'; var $mFFormat; - var $cClassName = 'FloatField'; - + function __construct($name) { + global $user; + + $this->class = 'FloatField'; $this->name = $name; + $this->mDelimiter = $user->decimal_mark; } - function setLocalization($i18n) { - FormElement::setLocalization($i18n); + function localize() { global $user; $this->mDelimiter = $user->decimal_mark; } @@ -54,19 +55,19 @@ class FloatField extends TextField { $value = sprintf('%'.$this->mFFormat.'f', $value); $value = str_replace('.', $this->mDelimiter, $value); } - $this->mValue = $value; + $this->value = $value; } function setValueSafe($value) { // '.' to ',' , apply delimiter if (strlen($value) > 0) - $this->mValue = str_replace('.', $this->mDelimiter, $value); + $this->value = str_replace('.', $this->mDelimiter, $value); } function getValueSafe() { // ',' to '.' - if (strlen($this->mValue) > 0) - return str_replace($this->mDelimiter, '.', $this->mValue); + if (strlen($this->value) > 0) + return str_replace($this->mDelimiter, '.', $this->value); return null; } }