Converting BigDecimal to Integer

后端 未结 8 1005
既然无缘
既然无缘 2020-12-04 14:43

I have Hibernate method which returns me a BigDecimal. I have another API method to which I need to pass that number but it accepts Integer as parameter. I cannot change ret

8条回答
  •  北海茫月
    2020-12-04 15:25

    I found that the above did not work for me. I was pulling a cell value from a JTable but could not cast to double or int etc. My solution:

    Object obj = getTable().getValueAt(row, 0);
    

    where row 0 would always be a number. Hope this helps anyone still scrolling!

提交回复
热议问题