Skip to main content

Currency Input

Enables monetary value input with currency formatting.

Examples

Basic Example

The following example demonstrate some of the available functionality for read_currency

from abstra.forms import read_currency

read_currency("How many credits do you want?", currency="USD", initial_value=10, min=10)

Parameters

NameDescriptionType
labelThe label to display to the userstr
initial_valueThe initial value to display to the user. Defaults to 0.str
placeholderThe placeholder text to display to the user. Defaults to "".str
minThe minimum value allowed, eg. "0". Defaults to None.float
maxThe maximum value allowed, eg. "100". Defaults to None.float
currencyThe currency to display to the user, eg. "USD", "BRL, "EUR", "GBP". Defaults to "USD".str
disabledwhether the input is disabled. Defaults to False.bool
requiredWhether the input is required or not eg. "this field is required". Defaults to True.Union[bool, str]
hintA tooltip displayed to the user. Defaults to None.str
full_widthWhether the input should use full screen width. Defaults to False.bool
button_textWhat text to display on the button when the widget is not part of a Page. Defaults to 'Next'.str

Return Values

TypeDescription
floatThe value entered by the user