Hi. I'm trying to get this script to show the total with 5% added on (tax).
The code i have here gets the total of the volume multiplied by the price but i can't seem to figure out how to then add 5% onto this total.....
Any ideas anyone?
Thanks in advance,
Ross.
The code i have here gets the total of the volume multiplied by the price but i can't seem to figure out how to then add 5% onto this total.....
Code:
var unitvalue=0
var dailyprice=0
function calculate(){
var litres=document.price.value
var selectunit=document.price.units.options[document.price.units.selectedIndex].value
if (selectunit=="300")
unitvalue=selectunit*0.5000
else if (selectunit=="500")
unitvalue=selectunit*0.4100
else if (selectunit=="600")
unitvalue=selectunit*0.4100
else if (selectunit=="700")
unitvalue=selectunit*0.4100
else if (selectunit=="900")
unitvalue=selectunit*0.4100
else if (selectunit=="1000")
unitvalue=selectunit*0.4100
else if (selectunit=="1200")
unitvalue=selectunit*0.4100
else if (selectunit=="1300")
unitvalue=selectunit*0.4100
else if (selectunit=="1800")
unitvalue=selectunit*0.4100
else if (selectunit=="2000")
unitvalue=selectunit*0.4050
alert (selectunit+" litres, including VAT, will cost:\n\n \u00A3"+unitvalue+"\n")
}
Thanks in advance,
Ross.
Comment