Skip to content

Instantly share code, notes, and snippets.

@mgryszko
Created February 6, 2021 16:01
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 mgryszko/3bad50d4fc71910628a06550fb6b21f5 to your computer and use it in GitHub Desktop.
Save mgryszko/3bad50d4fc71910628a06550fb6b21f5 to your computer and use it in GitHub Desktop.
def total(croissants: Pricing, baguettes: Pricing, breadRolls: Pricing): BigDecimal = {
val initialTotal = BigDecimal(0)
val croissantsTotal = initialTotal + total(croissants)
val baguettesTotal = croissantsTotal + total(baguettes)
baguettesTotal + total(breadRolls)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment