Skip to content

Instantly share code, notes, and snippets.

@spierala spierala/vat.js
Created Aug 12, 2014

Embed
What would you like to do?
node.js vat calculator usable in the console like this: node vat.js [netto]
var util = require('util');
VatCalculator = function (netto) {
this.netto = netto;
};
VatCalculator.prototype.calculate = function(parts) {
var vat = 0.19 * this.netto;
var brutto = Number(this.netto) + Number(vat);
util.puts("vat: " + vat);
util.puts("brutto: " + brutto);
}
var vatCalculator = new VatCalculator(process.argv[2]);
vatCalculator.calculate();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.