Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rounding large numbers #1612

Merged
merged 5 commits into from
Jul 13, 2024
Merged

Rounding large numbers #1612

merged 5 commits into from
Jul 13, 2024

Conversation

BrodyHughes
Copy link
Member

@BrodyHughes BrodyHughes commented Jul 3, 2024

Fixes BX-1550, BX-121, BX-1551

What changed:

  • this PR effects the swap review cards and the swap review
  • follow up PRs to follow changing this behavior elsewhere in the app
  • numbers >= 1,000 are now abbreviated using K, M, B, T, etc.

Screen recordings / screenshots

New behavior:
Screenshot 2024-07-02 at 11 07 26 PM
Screenshot 2024-07-02 at 11 05 58 PM
Screenshot 2024-07-02 at 11 08 23 PM
Screenshot 2024-07-09 at 3 46 58 PM

What to test

  • do large and small values round correctly on the review cards

Copy link

linear bot commented Jul 3, 2024

Copy link

github-actions bot commented Jul 3, 2024

Here's the packed extension for this build:
rainbowbx-413018a685e09f9c7d8952093de9d6397610631d

Copy link
Contributor

@estebanmino estebanmino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think @greg-schrammel already did this before ?

image

@greg-schrammel
Copy link
Contributor

yep formatNumber takes an options arg that you can add notation: 'compact'

import { formatCurrency } from '~/core/utils/formatNumber';

formatCurrency(num, { notation: 'compact', maximumSignificantDigits: 4 });

Copy link

linear bot commented Jul 9, 2024

Copy link

github-actions bot commented Jul 9, 2024

Here's the packed extension for this build:
rainbowbx-f73dbb0313522c016d42916b6a62523d56654506

Copy link
Collaborator

@DanielSinclair DanielSinclair left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like we're accidentally appending a $ to the swap bubble values
Screenshot 2024-07-11 at 6 35 17 PM

@BrodyHughes
Copy link
Member Author

It looks like we're accidentally appending a $ to the swap bubble values Screenshot 2024-07-11 at 6 35 17 PM

fixed this concern. nice catch.

Copy link

Here's the packed extension for this build:
rainbowbx-e94d026f56a5f51de234d52ad4a3c7f4b91109bc

Copy link
Member

@derHowie derHowie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌

@DanielSinclair DanielSinclair added this pull request to the merge queue Jul 13, 2024
Merged via the queue into master with commit 4140d8c Jul 13, 2024
17 checks passed
@DanielSinclair DanielSinclair deleted the brody/value-rounding branch July 13, 2024 05:46
Copy link

Here's the packed extension for this build:
rainbowbx-4140d8cdc9ce754666d2090b33df2c91a4a20275

@BrodyHughes BrodyHughes restored the brody/value-rounding branch November 27, 2024 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants