1. AlmostEqual2sComplement or BigDecimal Scaling stackoverflow.comUsing Java: The more I read on floating point value comparison, the more I get lost. In case of currency which is usually gets rounded off, what whoule you prefer..using Epsilon or ... |
2. Scale() of Divide method in BigDecimal stackoverflow.com
This returns 10 . But according to the API, the divide method:
Returns a BigDecimal whose value is (this / divisor), and whose preferred scale is (this.scale() ... |
3. Reduce scale of BigDecimal to that required to represent exactly? coderanch.com |
4. Determine number of decimal places? - BigDecimal.scale() doesn't make sense forums.oracle.comI have tried something like double aDouble String str = Double.valueOf(aDouble).toString(); str = str.substring(w1Str.indexOf(".") + 1); if(str.length() > 4) //throw error This approach works fine as long as the Double.toString() doesn't return a number in scientific notation. I've looked and haven't found a very good solution so far, so any suggestions would be welcome. I've tried to use BigDecimal.scale() to determine ... |
5. BigDecimal scale question forums.oracle.com |