Skip to content

Calculator Page Generator

Usage

  • Change the values in example and run the code block to get scaffolding for calculator.
  • Add calculation logic and publish.
Example

Say we wanted to create a Mile to Km calculator, then under #Example Usage change as follows:

  • title = "Miles to KM Converter"
  • field_labels = ["Miles"]
  • Run the code and then add conversion logic to the function:
// Initialise Variables
  let miles_val = values[0];

// Write calculation logic
  let kilometer_val = 1.6 * miles_val; 

// Display results
  const result = `${miles_val} miles is <strong>${kilometer_val} KM</strong>`;