Page last modified 12:51, 28 May 2018 by villes

.round()

    Table of contents

    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. 


    The XML snippet below would pass this check.

    <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>

    Menu