Skip to content

fix(tip): round a converted DM fee floor up - #1597

Merged
bmc08gt merged 1 commit into
code/cashfrom
fix/tip-floor-rounding
Sep 28, 2026
Merged

bmc08gt merged 1 commit into
code/cashfrom
fix/tip-floor-rounding

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Sep 28, 2026 •

Copy link
Copy Markdown
Collaborator

minimumToOpenDmWith converts the recipient's fee into the sender's currency and rounds it to the nearest cent. When the conversion lands under the half cent, the floor comes out below the fee: 600 INR at 95.95 INR/USD is $6.2533, stated as $6.25, which is 599.69 INR. The client accepts that tip and the server denies it. iOS reports the same denial as Bugsnag 6a67781, 117 events from 22 users.

inCurrency now rounds up through a new Fiat.roundedUp(). It has no other caller, so display conversions keep rounding half-up. The comparison against the entered amount is unchanged; $6.25 now fails against a $6.26 floor.

TipPaymentDelegateTest adds the INR case and a 1500 NGN fee at 1326 NGN/USD, which comes out $1.13 before the fix and $1.14 after.

The iOS fix is code-payments/code-ios-app#889.

Two limits remain. The conversion uses Double, so a fee that should convert exactly can pick up floating-point noise and round up a cent. rounded() and roundedUp() both fix two decimal places, so a JPY floor can come out fractional; that predates this change.

minimumToOpenDmWith rounded the recipient's converted fee to the nearest
cent. A 600 INR fee at 95.95 INR/USD is $6.2533, stated as $6.25, which is
599.69 INR, so the client accepted a tip the server then denied. iOS sees
the same denial as Bugsnag 6a67781.

inCurrency now rounds up through a new Fiat.roundedUp(). It has no other
caller, so display conversions keep rounding half-up.
@bmc08gt bmc08gt self-assigned this Sep 28, 2026
@github-actions github-actions Bot added type: fix Bug fix area: payments Payments, transfers, intents, billing area: network gRPC, connectivity, API, exchange rates labels Sep 28, 2026
@bmc08gt
bmc08gt merged commit acf84fa into code/cash Sep 28, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: network gRPC, connectivity, API, exchange rates area: payments Payments, transfers, intents, billing type: fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant