Георг Мосин Георг Мосин - 1 year ago 218
Android Question

BigDecimal in android api 16

I'm new to Android so please, explain me, how to use BigDecimal in API level 16, because using this line:

BigDecimal currentNumber = new BigDecimal(String "0.0");

results in an error, Call requires api level 24.

Answer Source

you are constructing the object wrong... BigDecimal is available since API1

you need to do:

BigDecimal currentNumber = new BigDecimal("0.0");

Note that I removed the unnecessary String Class just pass the value between quotes...

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download