Shopify / measured

Encapsulate measurements and their units in Ruby and Ruby on Rails.
MIT License
337 stars 28 forks source link

Don't cast values to `BigDecimal` #36

Closed thegedge closed 7 years ago

thegedge commented 7 years ago

Allow clients to decide what type of values a Measurable has. This allows clients to not incur the cost of a BigDecimal if they don't need it. When a non-integral calculation has to be made, we can coerce things to BigDecimal.

thegedge commented 7 years ago

Related: https://github.com/Shopify/measured/issues/35

thegedge commented 7 years ago

I've decided against doing this for now. Most operations here will likely involve non-integral numbers, so it's best to stay safe.