Add a calculation to a form

Hi,
I have a donation form:

import {sendEmail} from ‘backend/email’;

$w.onReady( function () {
$w(“#dataset1”).onAfterSave(sendFormData);
});

function sendFormData() {
const subject = New Submission **from** ${$w("#input15, #input4").value};
const body = Name: ${$w("#input15, #input4").value} \rDonation Type: ${$w("#radioGroup3").value} \rDonor Title: ${$w("#dropdown4").value} \rDonor First Name: ${$w("#input15").value} \rDonor Last Name: ${$w("#input4").value} \rDonor Company Name: ${$w("#input5").value} \rDonor Email: ${$w("#input6").value} \rDonor Phone: ${$w("#input7").value} \rDonor Street1: ${$w("#input8").value} \rDonor Street2: ${$w("#input9").value} \rDonor City: ${$w("#input10").value} \rDonor State: ${$w("#dropdown1").value} \rDonor Postcode: ${$w("#input14").value} \rDonor Name on Card: ${$w("#input11").value} \rDonor Card Number: ${$w("#input12").value} \rDonor Card Expiry Month: ${$w("#dropdown2").value} \rDonor Card Expiry Year: ${$w("#dropdown3").value} \rDonor CCV: ${$w("#input13").value} \rDonor Pay cc surcharge: ${$w("#radioGroup2").value} \rDonor Message: ${$w("#textBox1").value} \rDonor Pre Select Amount: ${$w("#radioGroup1").value} \rDonor Choice Amount: ${$w("#input1").value};

sendEmail(subject, body)
.then(response => console.log(response));
}

re the 2 bottom fields, Pre Select Amount and Choice Amount. A user can either select a preset amount or enter their own amount. Whichever they choose (call it x), I want to take that amount and apply the following formula ((x+0.3)/0.986)
and display:

  • the result (y) and
  • the difference y-x:

Could you please show me what code to add to achieve this. Thank you