The game essentially totals up gold cost for all units, and then divides by 15. Not sure if it calculates Sacreds separately, or just adds half for each to the total - but it certainly doesn't just round down on every individual unit.

Militia particularly are considered terrible in terms of upkeep/power.