Search the blog

No explanation needed:

vvar total        = 1200.50;
var vatRate       = 20; // Current value in UK
var vat           = total;
var percent       = 100 + parseInt(vatRate);
var newValue      = vat / percent;
newValue         *= 100;
vat               = total - newValue;

console.log(vat);  // 200.08
Tim Bennett is a web designer and developer. He has a First Class Honours degree in Computing from Leeds Metropolitan University and currently runs his own one-man web design company, Texelate.