Skip to content

fixup for 6/25 changes#139

Open
jenbreese wants to merge 1 commit into
devfrom
tvm-062526
Open

fixup for 6/25 changes#139
jenbreese wants to merge 1 commit into
devfrom
tvm-062526

Conversation

@jenbreese

Copy link
Copy Markdown
Collaborator

READY FOR REVIEW

Time Value of Money Calculator: Bug fixes and code quality improvements

Bug fixes

  • RATE with mismatched frequencies: Fixed incorrect effective annual rate being returned when compounding and payment frequencies differ. The solver now correctly returns the nominal annual rate by reversing the cross-frequency conversion on the solved per-period rate.
  • Validation error message formatting: Fixed negative currency constraint messages displaying as -$-1,000,000,000. Present value, future value, and payment error messages now correctly format as -$1,000,000,000.
  • Payment timing reset on tab switch: Payment timing no longer persists as "Beginning" when switching between solve-for tabs. It now resets to "End" along with the other fields.

Code quality

  • HowToUseInfoBox: Inlined the component JSX directly into the render output. Previously defined as a function inside Page(), it was recreated on every render, causing React to see a new component type each render and fully remount it, resetting any internal state.

onBlur={(e) => handleInputBlur(e.target.value, setPayment)}
className={`border-border pl-7 bg-card ${getFieldError("payment") ? "border-2 border-[var(--color-inline-error)]" : ""}`}
/>
{solveFor !== "PMT" &&

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not something we need fixed here, but I'm noticing a lot of code formatting with no actual changes. We should implement a unified code formatter so the code reviews are smaller.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants