mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-09-20 00:16:55 +02:00
3ccada55ab
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@90934 467b73ca-7a2a-4603-9d3b-597d59a354a9
24 lines
511 B
PHP
24 lines
511 B
PHP
<?php
|
|
/**
|
|
*
|
|
* @package sapphire
|
|
* @subpackage model
|
|
*/
|
|
class Double extends DBField {
|
|
|
|
function requireField() {
|
|
|
|
// HACK: MSSQL does not support double so we're usinf float instead
|
|
// @todo This should go into MSSQLDatabase ideally somehow
|
|
if(DB::getConn() instanceof MSSQLDatabase) {
|
|
DB::requireField($this->tableName, $this->name, "float");
|
|
} else {
|
|
DB::requireField($this->tableName, $this->name, "double");
|
|
}
|
|
}
|
|
|
|
function Nice() {
|
|
return number_format($this->value, 2);
|
|
}
|
|
}
|
|
?>
|