Calc Builder Support

Calc Builder support
Public write access is disabled. Please login

Help making a calculator 21.01.2020 14:43

I'm in doubt how to make a calculator.

need to convert a unit of weight (kg) into caloric weight, as follows:

if weight is <10kg = caloric weight is: weight x 1
if the weight is> 10kg and <20kg = (weight - 10) x 0.5 + 10
if weight is> 20 = (weight - 15) x 0.2 + 15


weight: ( form )
caloric weight: ( result )

result example 1:
Weight: 7kg
Caloric Weight : 7kg

result example 2:
Weight: 15kg
Caloric Weight : 12,5kg

result example 3:
Weight: 35kg
Caloric Weight : 18kg

Re: Help making a calculator 22.01.2020 08:55

first you need to create your input fields, in this case weight, that you will receive at the code section as $weight. Then you can write your math at the code section and introduce the result into your variable (if you call it 'result', then you need to fill the $result variable, for ex):


For your case you also need to use 'if' clauses, so you can check the proper syntax here:

In order to build this kind of code

if($weight<10) {

And finally, you can write your result at the output section with



Hope this helps, regards
Moonsoft Team
Are you satisfied with our products/services/support?
Please help us to keep improving, add a review at  joomla extensions site and  magento connect

Our clients' feedback