mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-09-06 09:41:36 +02:00
22 lines
457 B
PHP
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);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
?>
|