Hitachi Vantara Pentaho Community Forums
Results 1 to 3 of 3

Thread: User Defined Java Class - how to read a Number (decimal) input value

  1. #1
    Join Date
    Nov 2016
    Posts
    20

    Question User Defined Java Class - how to read a Number (decimal) input value

    Hi all,


    I have a Number field that contains values with a precision of 2.


    I am having trouble reading these fields in in my User Defined Java Class step.


    I have tried...
    Double incomingDecimalValue = get(Fields.In, "the_decimal_field").getDouble(r);


    The error returned is...
    "A method named "getDouble" is not declared in any enclosing class nor any supertype, nor through a static import"


    How do I pull in a decimal (Number) value into my Java code?


    Conversely, I am able to collect incoming integer values with...
    Long incomingDecimalValue = get(Fields.In, "the_decimal_field").getInteger(r);




    Cheers,


    Stanbridge

  2. #2
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    You only can use methods defined for class FieldHelper - getNumber() in your case.
    So long, and thanks for all the fish.

  3. #3
    Join Date
    Nov 2016
    Posts
    20

    Default

    Excellent. Thanks Marabu, that's an awesome reference link!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.