From: Scott Worley Date: Fri, 18 Aug 2023 05:28:14 +0000 (-0700) Subject: load_tax_table: Optional deductible X-Git-Tag: v1.1~3 X-Git-Url: http://git.scottworley.com/inverse-tax/commitdiff_plain/e66063161c51b0956d2ff3acabf778e8f2b4d045 load_tax_table: Optional deductible --- diff --git a/tax_ui.js b/tax_ui.js index 57bd361..0117dcc 100644 --- a/tax_ui.js +++ b/tax_ui.js @@ -1,8 +1,8 @@ "use strict"; -function load_tax_table(table_id, deductible_id) { - return apply_deductible(parse_tax_table(document.getElementById(table_id).value), - parseFloat(document.getElementById(deductible_id).value)); +function load_tax_table(table_id, deductible_id = null) { + const deductible = deductible_id == null ? 0.0 : parseFloat(document.getElementById(deductible_id).value); + return apply_deductible(parse_tax_table(document.getElementById(table_id).value), deductible); } function format_number(n) {