ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilADTFloatDefinition Class Reference
+ Inheritance diagram for ilADTFloatDefinition:
+ Collaboration diagram for ilADTFloatDefinition:

Public Member Functions

 reset ()
 Init property defaults.
 handleNumber ($a_value)
 getDecimals ()
 setDecimals ($a_value)
- Public Member Functions inherited from ilADTIntegerDefinition
 getMin ()
 setMin ($a_value)
 getMax ()
 setMax ($a_value)
 getSuffix ()
 setSuffix ($a_value)
 isComparableTo (ilADT $a_adt)
 Check if given ADT is comparable to self.
- Public Member Functions inherited from ilADTDefinition
 __construct ()
 Constructor.
 getType ()
 Get type (from class/instance)
 setAllowNull ($a_value)
 Toggle null allowed status.
 isNullAllowed ()
 Is null currently allowed.

Protected Attributes

 $decimals
- Protected Attributes inherited from ilADTIntegerDefinition
 $min_value
 $max_value
 $suffix
- Protected Attributes inherited from ilADTDefinition
 $allow_null

Detailed Description

Definition at line 5 of file class.ilADTFloatDefinition.php.

Member Function Documentation

ilADTFloatDefinition::getDecimals ( )

Definition at line 35 of file class.ilADTFloatDefinition.php.

References $decimals.

Referenced by handleNumber().

{
}

+ Here is the caller graph for this function:

ilADTFloatDefinition::handleNumber (   $a_value)

Reimplemented from ilADTIntegerDefinition.

Definition at line 22 of file class.ilADTFloatDefinition.php.

References getDecimals().

{
if(!is_numeric($a_value))
{
$a_value = null;
}
if($a_value !== null)
{
$a_value = round((float)$a_value, $this->getDecimals());
}
return $a_value;
}

+ Here is the call graph for this function:

ilADTFloatDefinition::reset ( )

Init property defaults.

Reimplemented from ilADTDefinition.

Definition at line 12 of file class.ilADTFloatDefinition.php.

References setDecimals().

{
$this->setDecimals(1);
}

+ Here is the call graph for this function:

ilADTFloatDefinition::setDecimals (   $a_value)

Definition at line 40 of file class.ilADTFloatDefinition.php.

Referenced by reset().

{
// max precision ?!
$this->decimals = max(1, abs((int)$a_value));
}

+ Here is the caller graph for this function:

Field Documentation

ilADTFloatDefinition::$decimals
protected

Definition at line 7 of file class.ilADTFloatDefinition.php.

Referenced by getDecimals().


The documentation for this class was generated from the following file: