In cases of appeal from a judgment of a justice of the peace, if the appeal be by the defendant, and judgment be rendered thereon for the plaintiff equal to or greater than that recovered by him before the justice of the peace, he shall recover of the defendant full costs; but if the judgment for plaintiff be less than that recovered by him before the justice of the peace, the court may, on motion of defendant, apportion the costs between the parties as may be proper, otherwise defendant shall be liable for all the costs. If the judgment on such appeal be rendered for the defendant, he shall recover of the plaintiff full costs. If the appeal be by plaintiff from a judgment rendered against him, and he recover judgment thereon, he shall recover of the defendant full costs; but if the defendant recover judgment thereon, he shall recover of plaintiff full costs. If a party appeal from a judgment in his favor, and does not obtain judgment for more than he recovered before the justice of the peace, he shall not recover costs that accrued on appeal, but shall be liable for such costs. But in such cases the circuit court, may, when the circumstances justify it, tax the costs to meet the ends of justice. In all cases where the principal is made liable for costs, judgment shall be rendered therefor against him and the sureties on his appeal bond jointly.