Defendant appeals from a judgment entered in favor of plaintiff for a commission for the sale of certain real estate in Rapid City, South Dakota. We affirm.
On June 23, 1973, plaintiff and defendant entered into a real estate listing agreement, the pertinent terms of which were as follows:
“In consideration of your agreement to use your efforts to find a purchaser, and to list with the members of the RAPID CITY MULTIPLE LISTING SERVICE, the real property described below, I hereby grant to you for the above term the *889exclusive irrevocable right and privilege to sell the following property * * * ,1
“If during said period, the property is sold by you or me or anyone else; or, if you, or any member of the RAPID CITY MULTIPLE LISTING SERVICE produce a purchaser ready, willing and able to purchase the property; or if within three months after the expiration of said period a sale is made to any person to whom the property has been shown by you or me or any said member of the MULTIPLE LISTING SERVICE, I agree to pay you a commission of 6% of the sale price. * * * Jf
This listing agreement expired by its own terms on August 23, 1973, and on September 7, 1973, defendant signed an authorization extending the listing agreement to December 31, 1973.
Plaintiff did not produce a purchaser for the property covered by the listing agreement, and on October 1, 1973, defendant entered into a contract for the sale of the property to a purchaser with whom he had negotiated directly. In April of 1974, plaintiff commenced an action to recover the commission based upon the price at which defendant had agreed to sell the property to the third party.
The defendant’s answer stated a general denial,2 and from his pretrial brief it appears that his original defense was based upon an alleged contemporaneous oral agreement that the renewal of the listing agreement would exclude B & C, Inc., the eventual purchaser of the property covered by the listing agreement. The trial judge ruled that the parol evidence rule would bar the introduction of any evidence of such an oral agreement. The defendant did not assign that ruling as error, nor does he raise it on appeal.
The matter was then submitted to the trial court entirely upon depositions and trial briefs. The trial court found generally for the plaintiff and against the defendant. The issue presented at the trial and in defendant’s appellate brief is stated in this fashion: “Must a broker, in order to recover compensation called for by its contract of employment, procure a person who is ready, willing and able to purchase on terms proposed by his principal?” In support of his position, the defendant cites a number of our decisions, i. e., Ericson v. Ebsen, 52 S.D. 97, 216 N.W. 860; Dobson v. Wolff, 74 S.D. 493, 54 N.W.2d 469; Rossum v. Wick, 74 S.D. 554, 56 N.W.2d 770; Mehlberg v. Redlin, 77 S.D. 586, 96 N.W.2d 399; Larson v. Syverson, 84 S.D. 31, 166 N.W.2d 424. See also, Richardson v. Kelley Land and Cattle Company, 8 Cir., 504 F.2d 30. Defendant’s reliance upon these cases is misplaced, however, because the listing agreement in question clearly provided that if the property was sold during the period covered by the agreement, defendant would be liable to plaintiff for a commission whether or not the purchaser was procured by plaintiff.
In presenting his argument in support of that issue, the defendant stated:
“In this case, it is admitted by Plaintiff 3 that neither they nor any other realtor sold the real estate, never showed the property, never presented any offers, never knew or met the ultimate purchasers, the property was never sold upon the listed terms during the life of the listing, the property was not sold during the listed time; in short, nothing was done upon which to predicate an earned fee. It is in this regard that the evidence clearly preponderates that the Trial Court’s Findings and Conclusions are not supported.”
*890The defendant’s assignments of error contain a similar allegation. Although he cites no authority therefor, it appears that the defendant attempts to argue that there was a failure of consideration by the plaintiff’s failure to use reasonable and diligent efforts to obtain a purchaser.4
SDCL 15-6-8(c) lists those defenses which must be set out affirmatively in the pleadings:
“In pleading to a preceding pleading, a party shall set forth affirmatively accord and satisfaction, arbitration and award, assumption of risk, contributory negligence, discharge in bankruptcy, duress, estoppel, failure of consideration, fraud, illegality, injury by fellow servant, lach-es, license, payment, release, res judicata, statute of frauds, statute of limitations, waiver and any other matter constituting an avoidance or affirmative defense. * * * ” (emphasis supplied)
The defense of failure of consideration is not put in issue by a general denial to the complaint but must be affirmatively pleaded. Kent Feeds, Inc. v. Stahi, 1976, S.D., 238 N.W.2d 483; Seaboard Surety Company v. Harbison, 1962, 7 Cir., 304 F.2d 247; Pacific Indemnity Company v. Wyrembek, 1960, D.C.Wis., 183 F.Supp. 252. See also 12 C.J.S. Brokers § 108. If an affirmative defense is not pleaded, it is waived to the extent that the party who should have pleaded it may not introduce any evidence in support thereof. 2A Moore’s Federal Practice ¶ 8.27[3]; Gajewski v. Bratcher, 1974, N.D., 221 N.W.2d 614; Durr v. Hardesty, 1956, 76 S.D. 232, 76 N.W.2d 393.
There are two exceptions to the general rule that affirmative defenses not pleaded are waived. It will not be waived if an amendment to set forth the affirmative defense is properly made. See SDCL 15-6-15(a); Federal Savings & Loan Ins. Corporation v. Szarabajka, D.C.Ill., 330 F.Supp. 1202; 2A Moore’s Federal Practice ¶ 8.27[3] at 1853.
The second exception to the rule is found in SDCL 15-6-15(b):
“ When issues not raised by the pleadings are tried by express or implied consent of the parties, they shall be treated in all respects as if they had been raised in the pleadings. Such amendment of the pleadings as may be necessary to cause them to conform to the evidence and to raise these issues may be made upon motion of any party at any time, even after judgment; but failure so to amend does not affect the result of the trial of these issues. If evidence is objected to at the trial on the ground that it is not within the issues made by the pleadings, the court may allow the pleadings to be amended and shall do so freely when the presentation of the merits of the action will be subserved thereby and the objecting party fails to satisfy the court that the admission of such evidence would prejudice him in maintaining his action or defense upon the merits. The court may grant a continuance to enable the objecting party to meet such evidence.” (emphasis supplied)
The fact that an affirmative defense has not been formally pleaded or an amendment made is immaterial if the issue was tried by express or implied consent. Sabbagh v. Prof. & Bus. Men's Life Ins. Co., 1962, 79 S.D. 615, 116 N.W.2d 513; Durr v. Hardesty, supra; Fredrick v. Christensen, 73 S.D. 130, 39 N.W.2d 529; Knapp v. Brett, 54 S.D. 1, 222 N.W. 297; City of Mitchell v. Dakota Central Telephone Co., 27 S.D. 509, 131 N.W. 1090. In Mitchell v. Kickapoo Prairie Broadcasting Company, 1960, D.C.Mo., 182 F.Supp. 578, the court, in ruling on plaintiff’s objection to the consideration of an affirmative defense, stated:
“It undoubtedly is true that this defensive matter normally is required to be pleaded and proved by defendants. However, counsel for defendants announced in opening statements as to Nova Nash that *891the defense would be that he was an exempt employee. Extensive evidence both direct and on cross-examination was introduced in the trial without objection. Within long established rules of procedure in this and other courts, plaintiff must be deemed to have waived the objection. The pleadings are considered amended to conform to the proof. Rule 15(b), F.R.Civ.P., 28 U.S.C.A.”
The test for allowing an adjudication of an issue under FRCP 15(b) and SDCL 15-6-15(b) tried by implied consent is whether the opposing party will be prejudiced by the implied amendment, i. e., did he have a fair opportunity to litigate the issue, and could he have offered any additional evidence if the case had been tried on the different issue.5 3 Moore’s Federal Practice ¶ 15.13[2] at 993; Lomartira v. American Automobile Insurance Co., 1967, 2 Cir., 371 F.2d 550; Deitz v. Bowman, 1975, D.C.S.D., 403 F.Supp. 1111. Where there has not been a fair opportunity for a party to be heard on the issue and/or additional evidence could have been offered, any implied amendment would be prejudicial and no trial by implied consent exists.
The settled record in this matter reveals several determining facts. The defendant’s answer was a general denial and was never amended to include any affirmative defenses, nor was the issue tried by the express consent of the parties. Defendant does make some references in the depositions and in his trial brief to the inadequacy of plaintiff’s efforts to find a purchaser; however, those references are invariably made in relation to defendant’s argument that the plaintiff was not a procuring cause of the sale. Nothing in the court’s findings of fact and conclusions of law, nor in defendant’s objections thereto, nor in defendant’s proposed findings raises the issue of failure of consideration.
Applying the previously stated test, it would be very prejudicial to the plaintiff to construe defendant’s passing references in the depositions and trial brief to plaintiff’s inadequate efforts as a trial by implied consent of the defense of failure of consideration.
In those cases where pleadings are considered amended to conform to the evidence (SDCL 15-6-15(b)), the consent is easily implied. For example, in Mitchell v. Kickapoo Prairie Broadcasting Company, supra, counsel for defendant announced the affirmative defense in opening statements, and extensive evidence both direct and on cross-examination was introduced in the trial without objection. The affirmative defense in Deitz v. Bowman, supra, was suggested in defendant’s answer, discussed at the pretrial conference and fully briefed by the plaintiff. None of those indicia of trial by implied consent are found in this case. There is no extensive evidence, and the issue was not discussed or briefed by either *892party at the trial level. In fact, it is questionable whether the defendant directly raises the issue on appeal. The many authorities and arguments presented by Justice Wollman in his dissent represent considerable research not found in the defendant’s appeal brief. We conclude that the defendant has waived the defense of failure of consideration by not pleading it affirmatively in his answer, and that the issue was not tried by the implied consent of the parties.
Finally, the defendant questions whether the trial judge correctly awarded prejudgment interest when the complaint did not include a specific request for such relief. The complaint demanded “judgment against the defendant in the sum of Thirty Thousand Dollars ($30,000.00) and for such other and further relief as the Court deems appropriate.”
SDCL 15-6-8(a) provides that “[a] pleading which sets forth a claim for relief * * shall contain * * * (2) a demand for judgment for the relief to which he deems himself entitled.” Good pleading practice would normally dictate that a demand for prejudgment interest be made. However, just as affirmative defenses not pleaded may be litigated under SDCL 15-6-15(b), “every [nondefault] final judgment shall grant the relief to which the party in whose favor it is rendered is entitled, even if the party has not demanded such relief in his pleadings,” under SDCL 15-6-54(c). Walkon Carpet Corporation v. Klapprodt, 1975, S.D., 231 N.W.2d 370; Bigley v. Brandau, 1973, 57 Wis.2d 198, 203 N.W.2d 735. However, the relief to be granted under SDCL 15-6-54(c) is not unlimited, and such relief must be based upon the facts alleged in the pleadings and justified by the proof at trial. 6 Moore’s Federal Practice ¶ 54.62 at 1265, 1271; Wright & Miller, Federal Practice and Procedure: Civil § 2662; see Shepherd v. Hub Lumber Co., 1975, 273 Or. 331, 541 P.2d 439. Therefore, if under the facts as established by the evidence, a claimant is entitled to prejudgment interest, the trial court should grant such relief even though it was not contained in the prayer for relief. Roth v. Fabrikant Bros., 1949, 2 Cir., 175 F.2d 665; Gardner v. Mid-Continent Grain Co., 1948, 8 Cir., 168 F.2d 819; Sanders v. City of Los Angeles, 1970, 3 Cal.3d 252, 90 Cal.Rptr. 169, 475 P.2d 201. See also, 47 C.J.S. Interest § 74.
Under SDCL 21-1-11, prejudgment interest may be allowed where (1) the damages are certain or are capable of being made certain by calculation and (2) the right to recover such damages vested upon a particular day. Peter Kiewit Sons' Co. v. Summit Construction Co., 1969, 8 Cir., 422 F.2d 242.
Applying the requirements of SDCL 21-1-11 to the facts in this case, we find (1) that the plaintiff sought to recover damages which were capable of being made certain by calculation, i. e., a 6% sales commission upon the sale price of the property covered by the exclusive listing agreement (6% X $350,000 = $21,000); and (2) that the right to recover such damages vested in the plaintiff on October 1, 1973, the date the binding contract was signed by the defendant and the purchaser.
The judgment is affirmed.
PORTER and MORGAN, JJ., concur. DUNN, C. J., and WOLLMAN, J., dissent.. The listing agreement is, by its terms, a bilateral contract, the defendant granting an “exclusive right to sell” in return for the plaintiffs promise of reasonable efforts to secure a purchaser. Williston on Contracts, Third Edition, Section 1287A; 12 Am.Jur.2d, Brokers, § 231.
. “The Defendant answers to the Complaint as follows:
I.
“The Defendant denies each and every allegation contained in the Complaint of the Plaintiff.
“Wherefore Defendant prays for judgment against the Plaintiff and his costs and disbursements herein and the Plaintiff’s Complaint be dismissed.”
.The plaintiff denied this in its brief.
. Inasmuch as the listing agreement was a bilateral contract (see footnote 1), the alleged lack of reasonable and diligent efforts was a failure of consideration rather than a lack of consideration.
. The dissent suggests that the plaintiff failed to show the use of reasonable and diligent efforts on the part of its agents and employees. However, since failure of consideration is an affirmative defense, the burden was upon the defendant to raise the issue. Although the plaintiffs president did state that he could not remember the amount and cost of the advertising, he did indicate that its attorney had the information in his brief case and that the defendant did not request that material. Likewise, the number of telephone calls, expenses, and prospective purchasers (by the plaintiff and other members of the Multiple Listing Service) were information which was available to the defendant through proper discovery procedures, which were not used, even though the president of the plaintiff indicated that such information would be ascertainable from its records.
It is also unclear whether the defendant argues the failure of consideration for the first listing agreement or the renewal. If he refers to the original listing, then there would have been the possible issue of estoppel for the plaintiff to raise; if he refers to the renewal, the defendant’s prevention of plaintiff’s performance of diligent efforts by the sale, without notice, sixty days before the expiration at a price some $150,000 less than the listed price would have been an issue. 12 C.J.S. Brokers §§ 83, 94.
The issue of whether the listing agreement is a bilateral or unilateral contract (see footnote 1), an exclusive agency or an exclusive right to sell (12 C.J.S. Brokers § 94; 12 Am.Jur.2d, Brokers, § 231) would have been important issues to be determined before the resolution of the failure of consideration question.