Skip to content
Advertisement

How to resolve Java.lang.numberformatexception: empty string

I have a utility function which convert parseDouble value to string.

JavaScript

I have tried with (o!=null && !isEmpty(o)) and (o!="" && o!=null) but it is still throwing same error.

Transaction amount which is processing this utility function contains empty value.

Advertisement

Answer

Firstly I don’t understand why you are taking object type as an input, however to resolve your issue you can do something like this. But I would strongly advice you to change the method signature it is misleading.

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement