rainbow-me / rainbow

🌈‒ the Ethereum wallet that lives in your pocket
https://rainbow.me
GNU General Public License v3.0
3.9k stars 607 forks source link

Match logic of balance badge to format max input value #5901

Closed jinchung closed 3 months ago

jinchung commented 3 months ago

Fixes APP-1627

What changed (plus any additional context for devs)

  1. The formatting for max input value was using the valueBasedDecimalFormatter which is slightly different from the logic that the balance badge uses. This PR ports over the essential logic of the balance badge into a worklet and uses that for formatting.
  2. This also fixes an issue with the non-worklet handleSignificantDecimals function that was copied over from helpers/utilities. A comment is added inline below describing the issue.

What to test

Screen recordings / screenshots

Simulator Screenshot - iPhone 15 Pro - 2024-06-27 at 22 54 32 Simulator Screenshot - iPhone 15 Pro - 2024-06-27 at 22 54 04 Simulator Screenshot - iPhone 15 Pro - 2024-06-27 at 22 53 28 Simulator Screenshot - iPhone 15 Pro - 2024-06-27 at 22 53 14

linear[bot] commented 3 months ago

APP-1627 Align the decimal formatting logic for max with the same one used for max balance