Forum Discussion

  • Yki's avatar
    Yki
    Contributor

    I am usually using "as BigDecimal"

    Example:

    def id = context.expand ('${testCaseProperties#id}') as BigDecimal

     

    but I just tried and it works for Integer the same way.

    def testnumber_one = "1"
    log.info "testnumber_one has class: " + testnumber_one.getClass()

    def testnumber_two = "4" as Integer
    log.info "testnumber_two has class: " + testnumber_two.getClass()

     

    • Tue Jun 13 16:34:21 CEST 2023: INFO: testnumber_one has class: class java.lang.String
    • Tue Jun 13 16:34:21 CEST 2023: INFO: testnumber_two has class: class java.lang.Integer