Subscribed unsubscribe Subscribe Subscribe

Mobile App Dev Diary

Android (Java, Kotlin), iOS (Swift), Xamarin (C#)

Compare BigDecimal value with zero (Android, Java)

use signum() .

BigDecimal bigDecimal = BigDecimal.valueOf(0.0);

if (bigDecimal.signum() == 0) {
    Log.i("compare", "is zero");
} else {
    Log.i("compare", "not zero");
}
Remove all ads