"""Readable cash-flow hedge bridge. Standard library only.""" def money(amount: float) -> str: """Format dollars with commas and parentheses.""" number = f"{abs(amount):,.0f}" return "$(" + number + ")" if amount < 0 else "$" + number opening_fair_value = 0.0 ending_fair_value = 48_000.0 opening_aoci = 0.0 earnings_reclassification = 0.0 basis_adjustment = 30_000.0 derivative_change = ending_fair_value - opening_fair_value current_oci = derivative_change ending_aoci = opening_aoci + current_oci - earnings_reclassification - basis_adjustment print("Linden Peak — supplied cash-flow hedge bridge") print("Designation, effectiveness, and fair values are supplied.") for label, value in [ ("Derivative fair-value change", derivative_change), ("Current OCI", current_oci), ("Earnings reclassification", earnings_reclassification), ("Inventory basis adjustment", basis_adjustment), ("Ending AOCI", ending_aoci), ]: print(f"{label:<34} {money(value):>14}") print("\nControl:", "PASS" if ending_aoci == 18_000 else "FAIL") print("Boundary: arithmetic does not qualify the hedge or validate fair value.")