The opinion of the court was delivered by
PAUL G. LEVY, J.A.D.Defendant was arrested on January 19, 1995, subsequently indicted, and entered a plea of not guilty on charges of possession of cocaine in a school zone. He posted bail set at $15,000. Shortly thereafter he was again arrested and charged with another drug-related offense, but that time he was unable to post the additional $20,000 bail, which the judge combined with the original bail as $35,000 consolidated bail for both offenses, so he spent the next 476 days in jail. He was acquitted of the second set of charges and then released from jail pursuant to the $15,000 bail originally posted.
Defendant entered a plea agreement, but one month later he moved to withdraw the plea and it was then that the jail credit issue surfaced. Judge Fast denied the motion to retract the plea, sentenced defendant to six years with two years parole ineligibility and reserved decision on the jail credits. Judge Fast issued a written opinion, published simultaneously herewith, holding that defendant was entitled to 476 days jail credit for time served while awaiting disposition on the indictment. 311 N.J.Super. 544, 710 A.2d 599 (Law Div.1997). The judge held the determination of jail time credits was a matter of judicial discretion, and exercising that discretion, he awarded the credit and ordered it applied against the base term of six years, rather than against the two year period of parole ineligibility. We affirm, essentially for the reasons *458expressed by Judge Fast, with the following comments and modifications.
We agree with Judge Fast’s ultimate analysis, as follows:
Specifically, here, defendant was in fact on bail on the subject charge but was unable to make the bail that had been imposed on the consolidation of the bail in the two cases. Because of the consolidation of the bail with a case which was dismissed, the defendant’s bail in this case became meaningless.
To put it otherwise, the time spent in jail by this defendant was not attributable to any other offense actually committed by him. While it may therefore be argued that the time served was directly attributable to this case, it was not in fact so attributable; the actual fact is that defendant was on bail on this indictment. Accordingly, the defendant’s incarceration cannot be said to have been solely attributable to the subject charge and he is therefore beyond the criterion of the rule.
[311 N.J.Super. at 547-48, 710 A.2d at 601].
R. 3:21-8 mandates jail credit when it applies, and it applies “for any time served in custody in jail or in a state hospital between arrest and imposition of sentence.” Judge Fast explicitly based his decision on considerations of fairness, justice and fair dealing as a matter of discretion, relying on State v. Marnin, 108 N.J.Super. 442, 445, 261 A.2d 682 (App.Div.), certif. denied, 55 N.J. 598, 264 A.2d 70, cert. denied, 400 U.S. 835, 91 S.Ct. 70, 27 L.Ed2d 67 (1970), as authority for exercising discretion.
The State, however, insists that a judge lacks authority to exercise such discretion because R. 3:21-8 “has repeatedly been interpreted to apply only to confinement ‘directly attributable’ to the specific offense,” citing State v. Mercadante, 299 N.J.Super. 522, 529, 691 A.2d 819 (App.Div.), certif. denied, 150 N.J. 26, 695 A.2d 668 (1997). In asserting this position, the State is critical of Judge Fast’s statement that the bail set for defendant was a consolidated bail, contending that either the judge or defendant must produce the transcript of a hearing at which the consolidation was made. Defendant provided a copy of a letter sent to him by his counsel on May 29, 1996, stating that Judge Fullilove “consolidated the two bails on the indictments and made it into a $35,000 bond only” on May 27, 1996, and a copy of the Prom-is/Gavel computer record indicates that bail was changed from $15,000 to $35,000 on May 24, 1996. Additionally, Judge Fast *459stated that the bails were consolidated on July 20,1995.1 Regardless of the date, we have no doubt that the bails were consolidated, and the State has not presented any contrary evidence. We agree with Judge Fast and conclude that defendant’s incarceration, even if not directly a consequence of the arrest in this case, was nevertheless fairly attributable to the indictment on which he was eventually sentenced.
The State concedes that had defendant been convicted of the offense for which he was acquitted, he would have been entitled to “gap time” for the time spent in jail, but it disdains the fairness or justice of affording credit under the circumstances here. It is the State’s position that is “clearly unreasonable so as to shock the judicial conscience,” a phrase so often quoted to sustain a sentence following conviction of a crime. Cf. State v. Roth, 95 N.J. 334, 365, 471 A.2d 370 (1984).
We differ with the sentence imposed on defendant in one respect. The jail time credits are to be applied to reduce a parole ineligibility term as well as the base term, if mathematically appropriate. See Booker v. New Jersey State Parole Bd., 136 N.J. 257, 263, 642 A.2d 984 (1994); State v. Mastapeter, 290 N.J.Super. 56, 64, 674 A.2d 1016 (App.Div.), certif. denied, 146 N.J. 569, 683 A.2d 1164 (1996). Thus we strike the condition against application of the jail credit to the period of parole ineligibility from the judgment of conviction. In all other respects, the decision of Judge Fast is affirmed.
That date appears to relate to some action taken by Judge Volkert, allegedly the issuance of a detainer.