0

Below is the code I currently using which I need to round the end result to 2 decimals.Can someone help me figure out what I did wrong.

total = panjang*ht+hf;
document.getElementById("ototal").innerHTML =eval(total(toFixed(2)));

1 Answers1

2

The variable total is a number, not a function. You should use toFixed function like this

total.toFixed(2)
Thum Choon Tat
  • 3,084
  • 1
  • 22
  • 24
  • 2
    This is a very low quality question. Please don't answer such low quality questions like this. Leave a comment, but don't answer. – random_user_name Oct 19 '17 at 02:20