Skip to main content
Big news! Interval has been acquired by Meter. Learn more →

io.input.number

Requests a numeric value.

Usage

const amount = await io.input.number("Amount", {
helpText: "Enter a number between one and ten.",
min: 1,
max: 10,
});
interval.com

Props

currency

Optional

string

Format the input to accept a currency value with a default of 2 decimals. One of USD, CAD, EUR, GBP, AUD, CNY, JPY.

decimals

Optional

number

The number of fractional decimal places acceptable.

defaultValue

Optional

number

Default value for the input.

disabled

Optional

boolean

Whether the input is disabled, preventing edits to the `defaultValue`.

helpText

Optional

string

Optional label providing additional context. Supports inline markdown elements like bold, italics, and links.

max

Optional

number

Maximum allowed value.

min

Optional

number

Minimum allowed value.

placeholder

Optional

string

Text to display in the input when no value is set.

prepend

Optional

string

Text to visually prepend to the provided value when displaying it.

Returns

number

Was this section useful?
On this page