How to auto populate input field with JQuery calculation results?

I am currently creating a flooring site in which the products require a calculator to price products. For example, a client inputs the length of the room and the with of the room and then the calculator tells you how many packs are required. I used J’Query to calculate this but now need the J’Query output to populate the quantity selector automatically. For example if the calculator says 20 packs are required the quantity selector automatically sets to 20. You can see a good example of this here: https://www.woodfloorwarehouse.co.uk/irish-oak

I will attach below the code for each section of this process as I am going wrong somewhere. Any help would be greatly appreciated.

J’QUERY for calculator (calculates how many packs are required):


The quantity input field I wish to auto populate using the above output:


        

          

            
            
            
          

        

      

The J’QUERY which I am using to try auto populate the input field above:


If you have any questions please let me know.

Thanks.