Skip to main content
CalcBuilder logo
CalcBuilder Forum

Some values are incorrect?

User moon_453

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??

User moon_453

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

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

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 40 hours

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

Buy now!
...
CalcBuilder

Create dynamic calculators

Buy now!