Package org.gbif.utils.number
Class BigDecimalUtils
java.lang.Object
org.gbif.utils.number.BigDecimalUtils
Utility class to work with BigDecimal.
See DoubleVsBigDecimal test class for more details about
BigDecimal-
Method Summary
Modifier and TypeMethodDescriptionstatic BigDecimalfromDouble(Double value, boolean stripTrailingZeros) Convert a double to a BigDecimal.
-
Method Details
-
fromDouble
Convert a double to a BigDecimal.- Parameters:
value- non-null value to convert into a BigDecimal.stripTrailingZeros- should the trailing zero(s) be removed? e.g. 25.0 would become 25- Returns:
- instance of BigDecimal
-