CalcBuilder Forum

Some values are incorrect?

Usuario moon_453 2012-04-27 15:27:57

Ok I have no idea what I am doing wrong. I have been working on this for awhile and it is getting annoying. There is NO preview button so I have to keep going back into the website to view if its working.

Variable ap1 is number default at 500
Variable nb1 is number default is 10% or .1
Variable num1 is number NO default


$commissions=$ap1*$nb1;
$inc1=$commissions*$num1;

$commissions2=$ap2*$nb2;
$inc2=$commissions2*$num2;

$sum=$inc1+$inc2*.6

This results in some values are incorrect??

Usuario moon_453 2012-04-27 15:32:01

Can the math be done with out having a field set up.

Such as $resultA=$num1+$num2; Then $sum=$resultA*10%

So it never shows $resultA and there is no variable for it? Only num1 and num2

Thanks

Moonsoft support 2012-04-27 17:34:41

Hello,

If you see "some values are incorrect" message, maybe the issue is not in code. Please check in Preferences section inside calculator in Backend; Frontend Number format -> Decimal and Thousand parameters are correctly set.

Hope this helps,

Moonsoft support 2012-04-27 17:39:39

Hello,

You can add/use new variables in code without a field created.

Although, you must note this is not correct:

$sum=$resultA*10%

Maybe this should be

$sum=$resultA*0.1;

Regards,

...
Support/development

Perfect for small code changes or to correct any bug at your site

Buy now!
...
Support/development 40 hours

With the peace of mind of having a professional team at your service (20% discount)

Buy now!