Forum


Calc Builder Support

Calc Builder support
Forums
No se permite escribir sin estar logado. Por favor, login

Simple Calculation!!!!!!!! 29.08.2012 15:11

I have what I thought was going to be a simple calculation but can't work out how to include it in to Calc Builder. As I said it is simple and I am sure that the answer is simple.

I want a visitor to be able to enter a value (no decimal) - No problem create a field

I then want to take that value and divide it by a constant (85,000) = A

I then want to round the result up to the next whole number (I would add .99 and then drop anything after the decimal point) = B

I also need to divide the result 'A' by a constant of 2 and then round it up to the next whole number.

The result are to be displayed in a column fashion (I think I have this sussed)

Calc one = Round down((amount/85,000)+.99)
Calc two = Round down(((amount/85,000)/2)+.99)

Re: Simple Calculation!!!!!!!! 29.08.2012 22:06

Hello,

in order to make the calculation work, you have to follow php sintax. Just add a $ sign before the variables/fields name and a ; at the end of each line. When using numbers in calculations (85000), avoid using decimal and thousand separators.
Also note you have available a function to do the rounding-up, the information is here:

http://php.net/manual/en/function.ceil.php

, so your line would be like this (assuming the user input field is called 'amount'):


$result1 = ceil($amount/85000);

and then you can go to the output layout and write ##result1## to show it as the first result, with the layout needed.


We suggest to download and check the example calculator 'first steps' to have an overview of the workflow to get and show the results.

Hope this helps,
Moonsoft Team
www.moonsoft.es

Re: Simple Calculation!!!!!!!! 04.09.2012 16:11

Thanks very much, working fine. Now just need to get a second calculation to work.
Are you satisfied with our products/services/support?
Please help us to keep improving, add a review at  joomla extensions site and  magento connect
FaLang translation system by Faboba

Lo que nuestros clientes opinan de nosotros