Assuming you mean that element "nani" doesn't get updated it is because you are attempting to set the value using
document.getElementById("nani").value =totalValue.toFixed();
and you do not have any elements with that Id.
You do have an element with that
name though
<input type="number" name="nani" required </p>
Try changing that to
<input type="number" id="nani" required </p>
Edit: Given that you have more named elements than those with Ids it might be better for you to switch to using
Document.getElementsByName()[
^] instead