• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

problem with over 10

 
Ranch Hand
Posts: 233
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey all, I am having some issues with this formula that accepts bulkQuantities (which are numbers that are set to qualify for the bulkPrice, and quantities which are the number of items that I want. If I go over 10 and if the item qualifies for bulkQuantity then you can see that the formula takes that into account. What I am having a problem with is non bulk quantity items.

When I enter more than 10 for non bulkquantity items(some are not eligble for Bulk prices) it bombs with an java.lang.ArithmeticException: / by zero error. Other than that it works fine. I know that it has something to do with the fact that its either greater than 10 or not and there is not a formula for non bulk quantity items.

Any suggestions?

Here is the code:


Thanks in advance
[ October 06, 2006: Message edited by: Gabriel White ]
 
Gabriel White
Ranch Hand
Posts: 233
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, figured it out.

Added a boolean and statement.

Done.
 
Be reasonable. You can't destroy everything. Where would you sit? How would you read a tiny ad?
Sauce Labs - World's Largest Continuous Testing Cloud for Websites and Mobile Apps
https://coderanch.com/t/722574/Sauce-Labs-World-Largest-Continuous
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!