Author Topic: Adding two numbers together [Solved]  (Read 405 times)

I'm wanting to add a number and variable together (side-by-side) w/o adding them.  If I did:

Code: [Select]
%deductionamt = 0. @ CityRPGData.getData(%group.bl_id).valueATMdeduct;
It gives me an error.  Otherwise, if I did:

Code: [Select]
%deductionamt = 0. + CityRPGData.getData(%group.bl_id).valueATMdeduct;
I believe it would output 10.0. [valueATMDeduct equals 10]
The output i'm trying to get is 0.10.
« Last Edit: January 12, 2013, 09:23:07 AM by Vaux »

%deductionamt = "0." @ CityRPGData.getData(%group.bl_id).valueATMdeduct;

Worked, thanks ;)  I didn't try that because I thought Torque handles strings and number the same.
« Last Edit: January 12, 2013, 09:22:12 AM by Vaux »

That's really silly.
Divide the number by 100.

%deductionamt = CityRPGData.getData(%group.bl_id).valueATMdeduct/100;

Also, the term for what you were attempting to do (using the @ operator) is concatenate, not add