Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Money inputs on charge, refund and payment forms parse floats instead of minor units

Đang mở
#1,995 4 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@deslawson đang làm issue này rồi.

Từ ngày 18/10/2026.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
58/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
nextjs, typescript
Lĩnh vực
frontend, payments

Hướng nghiên cứu

Inspect app/payments/new, app/admin/charge, app/admin/refund, and lib/WalletFundingModal.tsx to trace where free-text amounts are parsed. Find existing form, currency, and wallet-funding tests, then define coverage for decimal precision, JPY, large numbers, invalid characters, and min/max limits. The work is done when every listed form submits a safe integer in minor units matching the displayed amount.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug frontend NextJS Stellar Wave

Problem

app/payments/new and app/admin/charge send Number(amount) of whatever the user typed, app/admin/refund does Number(amount) on a string prefilled with String(payment.amount), and lib/WalletFundingModal.tsx uses parseFloat. The unit (minor vs major) is never stated in the UI, and free text allows 1e3, negative, fractional and multi-dot input; any conversion to minor units by multiplication would also hit floating point errors (for example 19.99 * 100 = 1998.9999999999998).

Proposed change

Add an AmountInput that accepts only digits and the currency's decimal places, converts with string math to integer minor units, enforces min/max, and use it in app/payments/new, app/admin/charge, app/admin/refund and the funding modal. Test with 0.1+0.2-style values, JPY and large numbers.

Acceptance criteria

  • The submitted payload amount is always a safe integer matching the displayed value.
Ngôn ngữ chính
TypeScript
Star
16
Fork
225
Merge trung bình
10 giờ 53 phút
Pull request đã merge (30 ngày)
66

Chuẩn bị môi trường

  • Có Dockerfile hoặc tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của DistinctCodes/ManageHub

Tất cả issue của DistinctCodes/ManageHub

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.