Skip to content

[Feature]: Input validation and formatting for Bitcoin Calculator widget #2447

@catch-21

Description

@catch-21

Describe the problem

Beyond use of numeric, there's no other input validation for the two fields on the Bitcoin Calculator widget. There are also some formatting improvements we could make to polish this widget.

Image Image Image Image

Describe the solution

I suggest the following:

  1. Do not allow 0 before any positive value for any currency
  2. Use consistent number of decimal places for fiat currencies. This is always 2 except for the exceptions , as far as I can tell, of KWD and BHD that use 3.
  3. Make it easier to read larger numbers by putting a gap between each group of 3 digits, as we do for balances.
  4. Cap the maximum input for bitcoin to 2_100_000_000_000_000. We could do the same for the fiat value if it results in a bitcoin value higher than this, or display something else, easter egg?
  5. Prevent engineering numbers from being displayed. I think this may be resolved by addressing 4.

Additional context

v1.0.9 (145)

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestfeature requestA user has an idea for the app

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions