ILIAS
release_6 Revision v6.24-5-g0c8bfefb3b8
◀ ilDoc Overview
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
$
_
a
b
c
d
e
f
g
h
i
j
l
m
p
s
t
w
+
Functions
_
a
b
c
f
g
h
i
s
t
w
+
Variables
$
c
d
e
f
g
h
j
l
m
p
s
t
+
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
+
Data Fields
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Variables
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Files
File List
+
Globals
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
+
Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
+
Variables
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Modules
Pages
class.ilADTFloatDefinition.php
Go to the documentation of this file.
1
<?php
2
3
require_once
"Services/ADT/classes/Types/Integer/class.ilADTIntegerDefinition.php"
;
4
5
class
ilADTFloatDefinition
extends
ilADTIntegerDefinition
6
{
7
protected
$decimals
;
// [float]
8
9
10
// default
11
12
public
function
reset
()
13
{
14
parent::reset();
15
16
$this->
setDecimals
(1);
17
}
18
19
20
// properties
21
22
public
function
handleNumber
($a_value)
23
{
24
if
(!is_numeric($a_value)) {
25
$a_value = null;
26
}
27
if
($a_value !== null) {
28
$a_value = round((
float
) $a_value, $this->
getDecimals
());
29
}
30
return
$a_value;
31
}
32
33
public
function
getDecimals
()
34
{
35
return
$this->decimals
;
36
}
37
38
public
function
setDecimals
($a_value)
39
{
40
// max precision ?!
41
$this->decimals = max(1, abs((
int
) $a_value));
42
}
43
}
ilADTIntegerDefinition
Definition:
class.ilADTIntegerDefinition.php:3
ilADTFloatDefinition\getDecimals
getDecimals()
Definition:
class.ilADTFloatDefinition.php:33
ilADTFloatDefinition\setDecimals
setDecimals($a_value)
Definition:
class.ilADTFloatDefinition.php:38
ilADTFloatDefinition\$decimals
$decimals
Definition:
class.ilADTFloatDefinition.php:7
ilADTFloatDefinition\reset
reset()
Definition:
class.ilADTFloatDefinition.php:12
ilADTFloatDefinition
Definition:
class.ilADTFloatDefinition.php:5
ilADTFloatDefinition\handleNumber
handleNumber($a_value)
Definition:
class.ilADTFloatDefinition.php:22
Services
ADT
classes
Types
Float
class.ilADTFloatDefinition.php
Generated on Tue Apr 8 2025 20:01:12 for ILIAS by
1.8.13 (using
Doxyfile
)