Template:Interactive calculator/doc

This template offers a selection of different interactive calculators. These use JavaScript to provide live in-page calculations. A calculator's result updates on pressing the 'Calculate' button, or when the user changes any of the input values.

Usage
Invoke with:

The type parameter is mandatory, and must be one of the enumerated values listed below in Supported calculators, or. Adding mode=test causes the calculator to run its unit tests and report the results. Parameters may also be supplied by position, in the order shown above.

The default input values to all the calculators are currently hardcoded. This template may be transcluded multiple times on a single page.

If type is, this template loads the core calculator JavaScript code, but does not display a calculator. Separate templates can use this to create other calculator types.

Tax withholding ratio
Invoke with:

Displays:

Calculates the "Tax Withholding Ratio" (TWR) for a nonresident alien, allowing comparison of US and non-US domiciled ETFs. The definition of TWR is. For full details, see: Template:TWR.

Compound interest
Invoke with:

Displays:

The calculation is, compounding an annual interest rate monthly over the given number of years. Enter interest rate as a percentage.

Future value
Invoke with:

Displays:

The result is calculated to match the results of the Microsoft Excel and Google Sheets  function.

Present value
Invoke with:

Displays:

The result is calculated to match the results of the Microsoft Excel and Google Sheets  function.

US nonresident alien estate tax
Invoke with:

Displays:

The result is the US estate tax that would be due on this level of 'US situs' assets for a US nonresident alien without US estate tax treaty coverage. Data for the tax rates was taken from Wikipedia US estate tax tables.

Compounded fund charges
Invoke with:

Displays:

Compounded loss to charges is. Enter charges as a percentage. For more, see the relevant wiki article.

Source code
For technical reasons, this template wraps its source code elements in Base64 encoding. This means that it is not directly visible in the wikitext editor. A listing of the decoded source code elements is shown below. For more on why this is necessary, and for general notes on how this template is designed and how to work with its JavaScript code, see Template Talk:Interactive calculator.