Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Last active July 8, 2019 23:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/dc40d0ef9ef45b1b4cec63c233f20b9d to your computer and use it in GitHub Desktop.
Save parzibyte/dc40d0ef9ef45b1b4cec63c233f20b9d to your computer and use it in GitHub Desktop.
BigDecimal total = new BigDecimal(0);
BigDecimal bd1 = new BigDecimal(50);
// Lo mismo que total += bd1
total = total.add(bd1);
// Lo mismo que total += 10
total = total.add(new BigDecimal(10));
// Lo mismo que total += 50
total = total.add(new BigDecimal(50));
System.out.println(total.toString()); // 110
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment