@tripetto/block-calculator
TypeScript icon, indicating that this package has built-in type declarations

4.0.6 • Public • Published

Tripetto FormBuilder SDK

🙋‍♂️ The Tripetto FormBuilder SDK helps building powerful and deeply customizable forms for your application, web app, or website.

👩‍💻 Create and run forms and surveys without depending on external services.

💸 Developing a custom form solution is tedious and expensive. Instead, use Tripetto and save time and money!

🌎 Trusted and used by organizations around the globe, including Fortune 500 companies.


This SDK is the ultimate form solution for everything from basic contact forms to surveys, quizzes and more with intricate flow logic. Whether you're just adding conversational forms to your website or application, or also need visual form-building capabilities inside your app, Tripetto has got you covered! Pick what you need from the SDK with visual form builder, form runners, and countless question types – all with extensive docs. Or take things up a notch by developing your own question types or even form runner UIs.


📦 Calculator Block

Version Downloads License Read the docs Source code Follow us on Twitter

Calculator block for Tripetto. Use the calculator block to instantly perform calculations inside forms, using given answers. The block includes operations, scores, comparisons, formulas, functions, constants and lots more features to be able to do all kinds of calculations. It is a headless block, so it doesn't require a UI implementation for the runner.

📺 Preview

Preview

Try the demo

🚀 Get started

You can find all the information to start with this block at tripetto.com/sdk/docs/blocks/stock/calculator/.

🧮 Supported operations

Operation Description
INPUTS
Static number Supplies a static number to the calculator.
Recall value Supplies the value of another question block (for example from a number block, rating block or scale block) to the calculator.
Subcalculation Performs a (sub) calculation for multistep formulas and supplies the result to the calculator.
FUNCTIONS
Limiting
min Returns the input with the lowest number.
max Returns the input with the highest number.
clamp Clamps (restricts) the input between the specified minimum and maximum value (learn more).
Floating point
round Rounds a floating point number (learn more).
floor Rounds a floating point number down (learn more).
ceil Rounds a floating point number up (learn more).
trunc Removes decimals from a floating point number.
Exponentiation
Multiplies the given input by itself (learn more).
Finds the principal square root for the given input (learn more).
pow Calculates the base to the power of the given exponent (learn more).
exp Calculates e to the power of the given exponent (learn more).
ln Calculates the natural logarithm of the input (learn more).
log Calculates the base 10 logarithm of the input (learn more).
Trigonometry
sin Calculates the sine of the given angle (learn more).
cos Calculates the cosine of the given angle (learn more).
tan Calculates the tangent of the given angle (learn more).
sin⁻¹ Calculates the inverse sine (arcsine) of the given number (learn more).
cos⁻¹ Calculates the inverse cosine (arccosine) of the given number (learn more).
tan⁻¹ Calculates the inverse tangent (arctangent) of the given number (learn more).
sinh Calculates the hyperbolic sine of the given hyperbolic angle (learn more).
cosh Calculates the hyperbolic cosine of the given hyperbolic angle (learn more).
tanh Calculates the hyperbolic tangent of the given hyperbolic angle (learn more).
sinh⁻¹ Calculates the inverse hyperbolic sine (arcsine) of the given number (learn more).
cosh⁻¹ Calculates the inverse hyperbolic cosine (arccosine) of the given number (learn more).
tanh⁻¹ Calculates the inverse hyperbolic tangent (arctangent) of the given number (learn more).
Factorial
n! Calculates the factorial of a positive number (learn more).
gamma Calculates the gamma of a positive number (learn more).
Miscellaneous
abs Retrieves the absolute value (or modulus) of a number (learn more).
age Calculates the age based on the input of a date block, for example a date of birth.
year Calculates the year of a given date.
month Calculates the month of a given date.
day of month Calculates the day of the month of a given date.
day of week Calculates the day of the week of a given date.
hour Calculates the hour of a given time.
minute Calculates the minute of a given time.
second Calculates the second of a given time.
millisecond Calculates the millisecond of a given time.
count Counts the number of selected options, for example from a calculator block, or a picture choice block (multiple selection).
mod Calculates the remainder of a division (learn more).
score Scores options of a block (for example a dropdown block, radio buttons block or a picture choice block).
sgn Extracts the sign of a number (learn more).
% Calculates a percentage of the input (learn more).
COMPARATORS
Compare value Compares the recalled value of another block and outputs a value based on the result of the comparison.
Compare current outcome Compares the current outcome of the calculator and outputs a value based on the result of the comparison.
Compare number Compares a static number and outputs a value based on the result of the comparison.
Compare date/time Compares a date (and time) and outputs a value based on the result of the comparison.
Check selected option Checks if a certain option is checked (for example from a multiple choice block) and outputs a value based on the result of the comparison.
TEXT FUNCTIONS
Character count Counts the number of characters in a text.
Word count Counts the number of words in a text.
Line count Counts the number of lines in a text.
Count occurrences Counts the number of occurrences of a certain text or character.
Convert to number Converts a text value to a number.
CONSTANTS
π Supplies the constant value of π (pi ≈ 3.14159) to the calculator (learn more).
e Supplies the constant value of e (Euler's constant ≈ 2.71828) to the calculator (learn more).
γ Supplies the constant value of γ (Euler–Mascheroni constant ≈ 0.57722) to the calculator (learn more).
c Supplies the constant value of c (speed of light = 299792458 m/s) to the calculator (learn more).
Random value Supplies a random value (0 to less than 1) to the calculator.
UNIX time Supplies the current UNIX time (seconds since Unix Epoch) to the calculator.
Year Supplies the current year to the calculator.
Month Supplies the current month (January = 1) to the calculator.
Day of month Supplies the current day of month (1-31) to the calculator.
Day of week Supplies the current day of week (Sunday = 0) to the calculator.
Hour Supplies the current hour (0-23) to the calculator.
Minute Supplies the current minute (0-59) to the calculator.
Second Supplies the current second (0-59) to the calculator.
Millisecond Supplies the current millisecond (0-999) to the calculator.
Timezone Supplies the current timezone (in milliseconds) to the calculator.

📖 Documentation

Tripetto has practical, extensive documentation. Find everything you need at tripetto.com/sdk/docs/.

🆘 Support

Run into issues or bugs? Report them here.

Need help or assistance? Please go to our support page. We're more than happy to help you.

💳 License

Have a blast. MIT.

✨ Contributors

👋 About us

If you want to learn more about Tripetto or contribute in any way, visit us at tripetto.com.

Package Sidebar

Install

npm i @tripetto/block-calculator

Weekly Downloads

340

Version

4.0.6

License

MIT

Unpacked Size

2.72 MB

Total Files

96

Last publish

Collaborators

  • markvandenbrink
  • martijnwijtmans
  • jurgenvandenbrink