
212 Cal.App.2d 685 (1963)
VICTOR BENNETT, Plaintiff and Respondent,
v.
BERNARD FRANCIS BROWN, Defendant and Appellant.
Civ. No. 10506. 
California Court of Appeals. Third Dist.  
Feb. 5, 1963.
 Desmond & Miller for Defendant and Appellant.
 A. John Merlo for Plaintiff and Respondent.
 SCHOTTKY, J.
 This is an appeal from an order retaxing costs.
 Victor Bennett brought an action against Bernard Francis Brown to recover damages for personal injuries incurred as a result of an assault and battery.
 On August 28, 1959, Bennett filed his complaint. On March 17, 1961, Brown served on counsel for Bennett an offer of compromise which read:
 "Offer of Defendant to Compromise"
 "To the Plaintiff Victor Bennett and to A. John Merlo, His Attorney:"
 "You and each of you will please take notice that the defendant, Bernard Francis Brown, does offer to allow judgment to be taken against him in the above-entitled action in the sum of $600.00 pursuant to the provisions of Section 997, Code of Civil Procedure of California."
 This offer was refused. The cause proceeded to trial and the jury returned a verdict of $500 in favor of Bennett. Bennett filed a cost bill totaling $198.40. Brown filed a cost bill of $570.30. The trial court awarded Bennett his costs and denied Brown's costs. This appeal followed:
 [1] Section 997 of the Code of Civil Procedure provides: "The defendant may, at any time before the trial or judgment, serve upon the plaintiff an offer to allow judgment to be taken against him for the sum or property, or to the effect therein specified. If the plaintiff accept the offer, and give *687 notice thereof within five days, he may file the offer, with proof of notice of acceptance, and the clerk, or the judge where there is no clerk, must thereupon enter judgment accordingly. If the notice of acceptance be not given, the offer is to be deemed withdrawn, and cannot be given in evidence upon the trial; and if the plaintiff fail to obtain a more favorable judgment, he cannot recover costs, but must pay the defendant's costs from the time of the offer."
 This section has been construed to mean that the plaintiff in an action may recover his costs accruing in his favor before an offer of judgment though he may recover a less favorable judgment and that he is to be charged with the defendant's costs after that time. (Douthitt v. Finch, 84 Cal. 214 [24 P. 929]; Robinett v. Brown, 167 Cal. 735 [141 P. 368]; Smith v. New York, O. & W. R. Co., 119 Misc. 506 [196 N.Y.S. 521].)
 In 13 California Jurisprudence 2d it is stated at page 230: "Although ordinarily a plaintiff, upon a judgment in his favor, is entitled as a matter of course to his costs in an action for recovery of money or damages or of personal or real property, where the defendant in good faith and with ability to perform offers, before trial or judgment, to allow judgment to be taken against him by way of compromise, and the plaintiff fails to accept and obtains a judgment less favorable than that offered, the plaintiff may not recover his costs incurred subsequent to the offer, but must pay the defendant's costs incurred after the offer."
 In the case at bench plaintiff's costs at the time of defendant's offer and before trial as taxed by the court were the following:
 Tabular Material Omitted
 The amount of the verdict was $500. Plaintiff's costs at the time the offer was made were $99.45. This is a total of $599.45 or below the amount of the offer which was $600.
 Respondent does not challenge the sufficiency of the offer but his principal argument is that the judgment as entered after the trial must be viewed in order to determine whether *688 the judgment is more favorable than the offer. The trial court expressed the same view.
 [2] It is a cardinal rule of statutory construction that a statute should, if possible, be given an interpretation which will give effect to the legislative intent and which is consistent with the real object and purpose of the statute. [3] We believe that the Legislature enacted section 997 of the Code of Civil Procedure for the purpose of encouraging the settlement of litigation without trial. The section was designed to give a defendant the right to offer to allow judgment to be taken against him for a specified amount and to provide that if the plaintiff did not accept said offer he could not recover any costs incurred after the date of the offer if he failed "to obtain a more favorable judgment." To determine whether a plaintiff has recovered a more favorable judgment costs incurred after the offer has been received must be excluded. If not, the portion of section 997 denying plaintiff his costs becomes meaningless.
 [4] It is true, as respondent contends, that one must look to the judgment in order to determine whether it is more favorable than the offer of settlement. If, for example, the judgment grants relief in addition to damages in favor of a plaintiff, such as specific performance or an order quieting title, then the mere fact that the damages recovered were below the amount of the offer of settlement would not preclude a plaintiff from recovering his total costs. [5] But when you have a cause of action seeking damages only and the verdict of the jury is less than the offer of settlement plus costs incurred to that time, the judgment is not more favorable and the rule of section 997 must be applied.
 If the rule were as contended by the respondent and all costs incurred could be included in determining whether the recovery was more favorable than the offer of settlement, then a plaintiff could in many instances by costs alone insure a more favorable judgment. Such result would defeat the purpose of the section and does not comport with the decisions of the decided cases. (See Douthitt v. Finch, supra, 84 Cal. 214; Robinett v. Brown, supra, 167 Cal. 735.)
 In view of the foregoing, we conclude that under a proper construction of section 997, with a view to carrying out what was undoubtedly the object sought to be accomplished by the Legislature, since the amount of the verdict ($500) and plaintiff's costs up to the time of the offer ($99.45) totaled less than the $600 offered by defendant, the plaintiff failed *689 "to obtain a more favorable judgment," and as provided in the section "he cannot recover costs, but must pay defendant's costs from the time of the offer." We therefore hold that the court erred in concluding that the plaintiff was entitled to recover his costs and that the defendant was not entitled to recover his costs from the time of the offer.
 The order retaxing costs is reversed with directions to the trial court to grant defendant's motion to strike plaintiff's costs after the time of the offer and to allow defendant the amount of his costs incurred after defendant's offer of compromise.
 Pierce, P. J., and Van Dyke, J.,  [fn. *] concurred.
NOTES
[fn. *]  *. Retired Presiding Justice of the District Court of Appeal sitting pro tempore under assignment by the Chairman of the Judicial Council.
