Civ. Code 3287(b) gives the trial judge broad discretionary power to award prejudgment interest in contract cases even when the damages are not certain or capable of being made certain. Uncertainty of damages alone would not be a proper reason to deny discretionary prejudgment interest under section 3287(b), but here, the trial judge also relied on the fact that the jury had awarded nearly all the lost profits damages estimated by HP’s expert including during the period Oracle delayed trial, and had considered, though in the end not given controlling weight to, the fact that Oracle had delayed the second phase of trial two years with a nearly frivolous appeal from denial of an Anti-SLAPP motion. Esgro Central, Inc. v. General Ins. Co. (1971) 20 Cal.App.3d 1054 supports the trial court’s approach, emphasizing the breadth of factors that a trial court may consider in deciding whether to award prejudgment interest under section 3287(b).