WooCommerce calculation and update quantity

Hi, I’m a big fan of GravityForms so I’m wondering if there is a way to meet my demands using GF.
I’m going to build a WooCommerce store with variable products. Each product variation having a different ‘length’. I’d like to make a G_form with a user input of needed total length and divide that by the choosen product variation’s length. So let’s say someone needs 10 meters and the choosen product variation B has a length of 0.9 meters. I’d like to calculate 10 / 0.9 = 11,11 and round that up to 12. So they need 12 pieces of product variation B. So based on the 12 i’d like to set the WooCommerce quantity to 12 so they can put that in the shopping cart. The calculation in GF is easy, but I would need the products variations length dynamically ánd update the quantity field.
Does anyone have a good idea how to do this?