|
@@ -18,11 +18,11 @@ class Currency extends Text
|
|
|
* @var array
|
|
|
*/
|
|
|
protected $options = [
|
|
|
- 'alias' => 'currency',
|
|
|
- 'radixPoint' => '.',
|
|
|
- 'prefix' => '',
|
|
|
+ 'alias' => 'currency',
|
|
|
+ 'radixPoint' => '.',
|
|
|
+ 'prefix' => '',
|
|
|
'removeMaskOnSubmit' => true,
|
|
|
- 'rightAlign' => false,
|
|
|
+ 'rightAlign' => false,
|
|
|
];
|
|
|
|
|
|
/**
|
|
@@ -51,16 +51,6 @@ class Currency extends Text
|
|
|
return $this->mergeOptions(compact('digits'));
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * @param mixed $value
|
|
|
- *
|
|
|
- * @return mixed
|
|
|
- */
|
|
|
- protected function prepareInputValue($value)
|
|
|
- {
|
|
|
- return str_replace(',', '', $value);
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* {@inheritdoc}
|
|
|
*/
|
|
@@ -73,4 +63,17 @@ class Currency extends Text
|
|
|
|
|
|
return parent::render();
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param mixed $value
|
|
|
+ *
|
|
|
+ * @return mixed
|
|
|
+ */
|
|
|
+ protected function prepareInputValue($value)
|
|
|
+ {
|
|
|
+ if (empty($value)) {
|
|
|
+ $value = 0;
|
|
|
+ }
|
|
|
+ return str_replace(',', '', $value);
|
|
|
+ }
|
|
|
}
|