mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR If CurrencyField->setValue() passed a null or empty value, default to 0.00 so number_format() has no issues converting the number (from r97566)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102509 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
1417722d9e
commit
6994e715ca
@ -13,6 +13,7 @@ class CurrencyField extends TextField {
|
||||
* if it is not a number (probably a currency symbol)
|
||||
*/
|
||||
function setValue($val) {
|
||||
if(!$val) $val = 0.00;
|
||||
$this->value = preg_replace('/^[^\d]/', '', $val);
|
||||
}
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user