When casting to instance of BigNumber, use a try {} catch {} instead of isNaN(parseFloat()) to determine if the value is a valid number.