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:
Ingo Schommer 2010-04-12 21:59:55 +00:00
parent 1417722d9e
commit 6994e715ca

View File

@ -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);
}
/**