Developer section PLANETCALC
Three steps to create a new calculator
To create a new calculator you must perform three simple tasks:
- Define input and result parameters.
- Write calculator code in JavaScript programming language.
- Write an article using MarkDown markup.
The calculator input parameters and result values can be defined using the calculator editor. The JavaScript code can also be edited using the calculator editor.
To make your new calculator available to site visitors you can write a short article (the calculator description) using the article editor. The article may contain calculators, tables, images and other features provided by MarkDown markup language.
To perform some calculations you may need some structured data. The PLANETCALC calculators can use data in XML, JSON or HTML-table formats from external websites.
In addition you may create data table or table hierarchy using the PLANETCALC handbook editor.
More information on calculator creation.
The calculators can reuse the parameters and algorithms of other calculators.
You can find more details regarding calculator creation in calculator developer articles:
- Tips and tricks #1: How to set output value
- Tips and tricks #2: How to make calculator translatable into different languages
- Tips and tricks #3: How to make calculator with custom errors
- Tips and tricks #4: How to make calculator with table output
- Tips and tricks #5: How to show/hide input and output controls in a calculator
- Tips and tricks #6: How to make calculator with virtual keyboard
- Tips and tricks #7: How to make calculator with SVG image map
- Tips and tricks #8: How to reuse existing calculator
- Tips and tricks #9: Big numbers
- Tips and tricks #10: Files, long calculation mode
Translation to foreign languages
The site user interface is translated into foreign languages. The calculators, articles and handbook can be translated into the same languages using translation editor.
A calculator developer should address future translation possibilities. Since any calculator parameter can be easily translated by the translation editor, any strings used in the calculator must be stored into special parameters (resources), instead of writing it directly in a calculator code.