silverstripe-framework/core/model/fieldtypes/Currency.php
Hayden Smith 4a5d9b03f8 Moved Sapphire module to open source path
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@39001 467b73ca-7a2a-4603-9d3b-597d59a354a9
2007-07-19 10:40:28 +00:00

22 lines
457 B
PHP

<?php
/**
* Currency value.
* Currency the currency class only supports single currencies.
*/
class Currency extends Decimal {
function Nice() {
// return "<span title=\"$this->value\">$" . number_format($this->value, 2) . '</span>';
return '$' . number_format($this->value, 2);
}
function Whole() {
return '$' . number_format($this->value, 0);
}
function setValue($value) {
$this->value = ereg_replace('[^0-9.]+','', $value);
}
}
?>