chapbook icon indicating copy to clipboard operation
chapbook copied to clipboard

Numeric input

Open samme opened this issue 4 years ago • 0 comments

Is your feature request related to a problem? Please describe.

I'd like to use input values in numeric calculations.

How many coins will you wager?

{text input for: 'wager'}

Now I have, e.g.,

// State:
wager: "5"

and after

winnings: wager + 5

I have

// State:
wager: "5"
winnings: "55"

Describe the solution you'd like

{text input for: 'wager', as: 'number'}

would convert to number, or (better IMO)

{number input for: 'wager'}

would render a number input, good for users on touch devices.

Describe alternatives you've considered

wager: Number(wager)
winnings: wager + 5

This is not beginner-friendly, you have to remember to do it everywhere you use the value, and it still leaves the original string value in History.

samme avatar May 22 '20 18:05 samme