Floor node
Description
The Floor node takes one number as input and rounds it down to the previous whole number, e.g. 9.98 becomes 9
Usage
The Floor node is a function, so it can be added to the segments of comparison nodes and other functions.
It can be:
-
added to these comparison nodes:
- Equals
- Greater than
- Less than
- Not Equals
-
compared against, and populated with, these nodes:
- Attribute (of Number type)
- Count
- Number
- Length
- all other Arithmetic nodes
Configuration
-
Swap - change the comparison node. If any segments hold values, they'll remain but the node types offered will be limited.
-
Delete - remove the node.
Example
Fetch all Trees with a crown base of 2 metres when rounded up or down
In full detail:
Fetch items of the Trees design where the ceiling of their Crown Base (m) attribute equals 2 OR the floor of their Crown Base (m) attribute equals 2
See JSON code
This code may reference designs, interfaces, attributes or items that don't exist in your Alloy database.
{
"type": "Query",
"properties": {
"collectionCode": "Live",
"dodiCode": "designs_trees"
},
"children": [
{
"type": "Or",
"children": [
{
"type": "Equals",
"children": [
{
"type": "Number",
"properties": {
"value": [2]
}
},
{
"type": "Ceiling",
"children": [
{
"type": "Attribute",
"properties": {
"attributeCode": "attributes_treesCrownBase"
}
}
]
}
]
},
{
"type": "Equals",
"children": [
{
"type": "Number",
"properties": {
"value": [2]
}
},
{
"type": "Floor",
"children": [
{
"type": "Attribute",
"properties": {
"attributeCode": "attributes_treesCrownBase"
}
}
]
}
]
}
]
}
]
}