X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/dd8defde4b1f44f56cf9ef3c3b6b435a70faaae9..1cf228c258ba8a8950b1a55bc25b93768bf50184:/WEB-INF/lib/form/FloatField.class.php diff --git a/WEB-INF/lib/form/FloatField.class.php b/WEB-INF/lib/form/FloatField.class.php index 9cd38bfd..5b939754 100644 --- a/WEB-INF/lib/form/FloatField.class.php +++ b/WEB-INF/lib/form/FloatField.class.php @@ -29,19 +29,20 @@ import('form.TextField'); class FloatField extends TextField { - var $mDelimiter = '.'; var $mFFormat; - var $cClassName = 'FloatField'; - + function __construct($name) { - $this->mName = $name; + global $user; + + $this->class = 'FloatField'; + $this->name = $name; + $this->mDelimiter = $user->getDecimalMark(); } - function setLocalization($i18n) { - FormElement::setLocalization($i18n); + function localize() { global $user; - $this->mDelimiter = $user->decimal_mark; + $this->mDelimiter = $user->getDecimalMark(); } function setFormat($format) { @@ -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; } }