.round()
Method returns the nearest integer of the given value.
Description of the method
Description: | .round() method returns the nearest integer of the given value. |
Available for: | integer, real |
Parameters: | - |
Return type: | integer |
Example
Context: | TransactionType1 |
OCL: | self.Amount.round() = 30 |
Description: | The example rule compares the nearest integer of the amount to the integer 30. If the nearest integer is 30, true will be returned. |
<Amount>30</Amount>
Also the XML snippet below would pass this check.
<Amount>29.5</Amount>
The snippet below however would not pass this check.
<Amount>25.3</Amount>