I right script in Ruby that include java classes
require 'java'
include_class 'java.math.BigDecimal'
include_class 'java.math.RoundingMode'
during the script I need to divide 2 java.bigDecimal
one = BigDecimal.new("1")
number1 = BigDecimal.new("3")
number1 = one.divide(number1,RoundingMode.new(HALF_EVEN))
since I don't have intellisense in this IDE I'm not sure the syntax is right and the runtime error is:
uninitialized constant::HALF_EVEN
- do I combine java object in the ruby scrpit in the right way?
- how should I divide two java.bigDecimal object in ruby env?