Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Invoice generator shows a subtotal of -$0.00 when the line items cancel out

オープン
#315 コメント 2 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@shresthgoel77-png がすでに取り組んでいます。

2026年10月23日 から。

  • #331 @shresthgoel77-png による — オープン

評価

この issue はまだ評価されていません。

説明

bug good first issue hacktoberfest

In the invoice generator, add three line items with tax at 0: "Website build" 1200.00, "Deposit received" -1000.10 and "Credit" -199.90. the subtotal shows "-$0.00", while tax and total show "$0.00". In floating point the sum is about -2.8e-14, and roundTo (lib/invoice-types.ts, lines 82 to 93) turns that into -0: it rounds the absolute value to 0 and then multiplies by the sign (line 92). Intl.NumberFormat prints -0 as "-$0.00", in the preview (InvoicePreview.tsx, line 118) and in the PDF (lib/invoice-pdf.ts, line 263).

What to do

  • Make roundTo return 0 instead of -0, so every caller gets the fix.

Where to look

  • lib/invoice-types.ts: roundTo (lines 82 to 93) and computeTotals (lines 95 to 107)
  • lib/__tests__/invoice-types.test.ts

Acceptance criteria

  • The example above shows a subtotal of "$0.00"
  • A real negative amount (a -200.00 line on its own) still shows its minus sign
  • Tests that fail on the current code
  • npm run lint, npm run test and npm run build pass

Want to work on this? Comment below and I'll assign it to you. Please take one issue at a time, branch off develop, and open your PR against develop with Closes #315 in the description.

主要言語
TypeScript
スター
1
フォーク
9
平均マージ
7時間 34分
マージ済み PR(30日)
146

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

codercops/toolbelt のほかの issue

codercops/toolbelt の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。