Forum


Calc Builder Support

Calc Builder support
Forums
Public write access is disabled. Please login

incorrect code 27.04.2012 03:20

whats wrong here

$ac=$p1*$.1;
$ai=$num1*$ac;
$sum=$a1*$.8;

the only two variable fields are p1 and num1 im trying to have all the math done on the back end and display results when i try this it says something is incorrect.

thanks
dave

Re: incorrect code 27.04.2012 09:47

Hello,

Your code:

$ac=$p1*$.1;
$ai=$num1*$ac;
$sum=$a1*$.8;

We don´t know exactly what you want but maybe $.1 could throws a syntax error. If you want to multiply just :

$ac=$p1*.1;

or

$ac=$p1*0.1;

$ is used only for variables not if you want to use a number in this case.

Hope this helps. Regards,

Moonsoft Team
Moonsoft Team
www.moonsoft.es

Re: incorrect code 27.04.2012 14:57

Ok and the $ac there is no created variable for this. I need a result in order to do the next calculation. Do I keep it like this or do I need to create another field?

Thanks

Re: incorrect code 27.04.2012 17:09

Hello,

That´s ok. You don´t need to create a field with variable ac to use it in Code. In fact, when you write $ac=$a*0.1 you are creating a variable $ac and you can use it in exit layout as ##ac## to see it in result.

Regards,

Moonsoft Team
Moonsoft Team
www.moonsoft.es
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