printf does not support %f.
Something like printf("%ld", (long)(ratio * 1000) ); might work, though you're likely to run into a lot of problems with floats.
You can avoid floats entirely by shifting the number up to store your decimal places, but in an integer type. Then in calculations, shift it back down.
For example:
Code:
long ratio;
ratio = (((long)p1_x)<<8 ) / S_PWM_SWING;
if(ratio>128 && magnitude_sum>MAX_SINGLE_MOT_MAG){
RIGHT_WHEEL_PWM=NEUTRAL+MAX_SINGLE_MOT_MAG;
LEFT_WHEEL_PWM=NEUTRAL-(((1<<8 - ratio) * MAX_SINGLE_MOT_MAG)>>8);
}
Keep in mind that bit shifts only work on integers, so 0.5<<8 actually becomes 0<<8, so instead of 128, you get 0. You'll have to enter any decimal constants yourself.
(In case you don't already know, x<<8 = x*(2^8) and x>>8 = x/(2^8).)