number_to_use = round(1.25f + 4.0f * battle_size * clamp(((15.0f + advantage) / 15.0f), 0.2f, 2.5f) * number)
where battle size is taken from options, advantage is obvious, and number is (own + allied) army size. you can learn about battle_size values from config file (under My Documents).
Ignoring the 'f's and doing 1.25 + 4 * BattleSize * ((15+Advantage)/15) * FriendlyPartySize doesn't work at all. Even after clamping the ((15+Advantage)/15) between 0.2 and 2.5, the number being multipled by the number of friendlies is much larger than 1, greatly inflating the result, rather than scaling it down.
How do I convert the 'f' values to integers/real numbers than I can use to calculate this? What am I missing?