BigDecimal Divide Missing Decimal

Jul 20, 2020

Work

Use divide, not div or /

845.toBigDecimal().divide(BigDecimal(100))  // 8.45"845.00".toBigDecimal() / BigDecimal(100)   // 8.45BigDecimal(845.toBigInteger(), 2)           // 8.45

Doesn't Work

845.toBigDecimal().div(BigDecimal(100))           // 8845.toBigDecimal().div(BigDecimal("100.00"))      // 8845.toBigDecimal() / BigDecimal(100)              // 8845.toBigDecimal() / BigDecimal("100.00")         // 8(845.00).toBigDecimal()/ BigDecimal(100)          // 8.4

❤️ Is this article helpful?

Buy me a coffee ☕ or support my work via PayPal to keep this space 🖖 and ad-free.

Do send some 💖 to @d_luaz or share this article.

✨ By Desmond Lua

A dream boy who enjoys making apps, travelling and making youtube videos. Follow me on @d_luaz

👶 Apps I built

Travelopy - discover travel places in Malaysia, Singapore, Taiwan, Japan.