Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

999/2 decimals percentage #1315

Merged
merged 5 commits into from
Aug 31, 2021
Merged

999/2 decimals percentage #1315

merged 5 commits into from
Aug 31, 2021

Conversation

alfetopito
Copy link
Contributor

@alfetopito alfetopito commented Aug 25, 2021

Summary

Closes #999
Closes #1148

2 decimals precision for price impact

screenshot_2021-08-25_13-35-08

To Test

  1. Fill in all inputs while on Mainnet or xDai
  • Observe price impact is limited to 2 decimals precision
  • When percentage < 0.01, it shows < 0.01
  • It does not display insignificant zeros: 0.90 => 0.9

@alfetopito alfetopito self-assigned this Aug 25, 2021
@alfetopito alfetopito requested review from a team August 25, 2021 20:39
@github-actions
Copy link
Contributor

  • 🔭 GP Swap: Gnosis Protocol v2 Swap UI

Copy link
Contributor

@anxolin anxolin left a comment

Choose a reason for hiding this comment

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

Would these also be affected?

Copy link

@elena-zh elena-zh left a comment

Choose a reason for hiding this comment

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

0% of the price impact is displayed when it's amount is less than 0.01%.
image

Prod:
image

All the rest changes LGTM!

@elena-zh
Copy link

Hey @alfetopito , we have related low priority UI issue with price impact #1148 : could you please take a look at it in this pr as well?
It might be easy to fix. :)

Copy link
Contributor

@W3stside W3stside left a comment

Choose a reason for hiding this comment

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

nice!

@alfetopito
Copy link
Contributor Author

Would these also be affected?

* https://github.com/gnosis/cowswap/blob/ff8ae7cd447262da984f1b46cbdd702bae5e3752/src/custom/components/CurrencyInputPanel/FiatValue/FiatValueMod.tsx#L46-L46

* https://github.com/gnosis/cowswap/blob/2f9bb89d5a7846a2b559be9cc840e871fb4e97da/src/custom/components/swap/TradeSummary/index.tsx#L69-L69

First one, is literally the one I had changed XD
The second wasn't part of this, but sure, updated.

@alfetopito
Copy link
Contributor Author

0% of the price impact is displayed when it's amount is less than 0.01%.
image

This should probably be fixed after I merge #1281
I'll do that then try again to be sure.

@alfetopito
Copy link
Contributor Author

Hey @alfetopito , we have related low priority UI issue with price impact #1148 : could you please take a look at it in this pr as well?
It might be easy to fix. :)

It was! Take a look now.

@elena-zh
Copy link

It was! Take a look now.

Great! Fixed! Thanks

Copy link
Contributor

@W3stside W3stside left a comment

Choose a reason for hiding this comment

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

APPROVED AGAIN

@alfetopito alfetopito added the Auto-merge PRs with this tag will be automatically merged when approved and CI succeeds label Aug 31, 2021
@mergify mergify bot merged commit c59cf98 into develop Aug 31, 2021
@alfetopito alfetopito deleted the 999/2-decimals-percentage branch August 31, 2021 17:23
W3stside pushed a commit that referenced this pull request Sep 22, 2021
# Summary

Closes #999 
Closes #1148

2 decimals precision for price impact

![screenshot_2021-08-25_13-35-08](https://user-images.githubusercontent.com/43217/130860763-3c212bf4-04ba-4e69-b137-025a3a245a47.png)


  # To Test

1. Fill in all inputs while on Mainnet or xDai
* Observe price impact is limited to 2 decimals precision
* When percentage < 0.01, it shows `< 0.01`
* It does not display insignificant zeros: 0.90 => 0.9
This was referenced Sep 22, 2021
anxolin pushed a commit to anxolin/cowswap that referenced this pull request Apr 1, 2022
# Summary

Closes #999 
Closes gnosis/cowswap#1148

2 decimals precision for price impact

![screenshot_2021-08-25_13-35-08](https://user-images.githubusercontent.com/43217/130860763-3c212bf4-04ba-4e69-b137-025a3a245a47.png)


  # To Test

1. Fill in all inputs while on Mainnet or xDai
* Observe price impact is limited to 2 decimals precision
* When percentage < 0.01, it shows `< 0.01`
* It does not display insignificant zeros: 0.90 => 0.9
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Auto-merge PRs with this tag will be automatically merged when approved and CI succeeds
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Price impact - Space missing Percentages are not rounded to 2 decimals
4 participants