Drupal commerce: product field based in calculation of other fields
Commerce out of the box has a quantity field and does by default a 'price-per-unit'. Watch this tutorial to give you an idea of how it works without any customizations. 

https://www.youtube.com/watch?v=3KEJcieG4jI