Repository navigation
fix(tip): round a converted DM fee floor up - #1597
Merged
Merged
Conversation
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.
This was referenced Sep 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
minimumToOpenDmWithconverts 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 Bugsnag6a67781, 117 events from 22 users.inCurrencynow rounds up through a newFiat.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.TipPaymentDelegateTestadds 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()androundedUp()both fix two decimal places, so a JPY floor can come out fractional; that predates this change.