Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Token metadata display decimals not work for 0 value #556

Open
JoaoCampos89 opened this issue Jul 3, 2019 · 0 comments
Open

Token metadata display decimals not work for 0 value #556

JoaoCampos89 opened this issue Jul 3, 2019 · 0 comments

Comments

@JoaoCampos89
Copy link

The new config does not work well when the display decimals value is set to 0 on the tokens config file, which as result will turn back to the default value defined in UI_DECIMALS_DISPLAYED_DEFAULT_PRECISION.
When:
tokenMetaData.displayDecimals = 0 and
UI_DECIMALS_DISPLAYED_DEFAULT_PRECISION = 2
tokenMetaData.displayDecimals || UI_DECIMALS_DISPLAYED_DEFAULT_PRECISION --> this resolves to 2

When the value should be 0 as defined on the config. A possible solution could be:

tokenMetaData.displayDecimals !== undefined ? tokenMetaData.displayDecimals : UI_DECIMALS_DISPLAYED_DEFAULT_PRECISION;

This logic happens on util/token_meta_data.ts

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant