I’m not 100% sure of your question here but can see you’ve got a JS snippet, and some Liquid.
To kick us off:
You can do division in JS or Liquid. Liquid will do the math once and since there’s variants involved I am assuming this needs to be dynamic as a customer changes options. JS is likely the better path if so.
You can not take JS derived value and use Liquid to divide. JS runs long after Liquid has finished and one is client side, the other server side.
You can take values rendered with Liquid and do things with them in JS.
Come back with more specific example or context so I understand the need.