-
Notifications
You must be signed in to change notification settings - Fork 20
Description
When showing token amounts Seafood currently rounds out tokens that are very small against usd. For example Seafood shows 0.00 assets for this USDR vault when the correct value us 0.00000806.
https://seafood.yearn.watch/vault/0x531fDb1C8429F404116932226D487db94471C4b7
Update Seafood to work like this instead:
Tasks
-
Update
formatNumber
to include compact forms for numbers less than zero using greek si units for milli, micro, nano, and pico. For numbers greater than zero change the logic to use an uppercase unit. For numbers less than zero use lowercase. Here'sformatNumber
:
Line 38 in 9d96454
function formatNumber(number, decimals = 2, nonFinite = '∞', compact = false) { -
Add tests here to demonstrate the new formats work:
https://github.com/yearn/seafood/blob/main/src/utils/utils.test.js -
Update the
Tokens
component to support hover and click features. Use a localstorage value to store the user's current preference (unclicked vs clicked, ie compact vs expanded):
export function Tokens(