Skip to content

refactor: rewrite sudtValueToAmount with formatUnit in neuron-ui - #3126

Merged
Keith-CY merged 2 commits into
nervosnetwork:developfrom
twhy:refactor-sudtValueToAmount-with-formatUnit-neuron-ui
Apr 16, 2024
Merged

refactor: rewrite sudtValueToAmount with formatUnit in neuron-ui#3126
Keith-CY merged 2 commits into
nervosnetwork:developfrom
twhy:refactor-sudtValueToAmount-with-formatUnit-neuron-ui

Conversation

@twhy

@twhy twhy commented Apr 15, 2024

Copy link
Copy Markdown
Contributor

The fourth param separator = ',' has been replaced by showCommaSeparator = true to make things simpler.

In our use cases, we just need to control show/hide commas in numbers, instead of customizing the separator.

Delegating the work to Intl.NumerFormat make the code simpler.

Comment thread packages/neuron-ui/src/utils/formatters.ts
Co-authored-by: homura <homura.dev@gmail.com>
@Keith-CY
Keith-CY added this pull request to the merge queue Apr 16, 2024
Merged via the queue into nervosnetwork:develop with commit 359d7b7 Apr 16, 2024
@twhy
twhy deleted the refactor-sudtValueToAmount-with-formatUnit-neuron-ui branch April 16, 2024 08:37
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.

4 participants