Skip to main content

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.

alt text

It can be:

Configuration

alt text
  • 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

alt text
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"
}
}
]
}
]
}
]
}
]
}