Currency Input
info
This widget is deprecated. Use the Currency Input widget instead.
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
Name | Description | Type |
---|---|---|
label | The label to display to the user | str |
initial_value | The initial value to display to the user. Defaults to 0. | str |
placeholder | The placeholder text to display to the user. Defaults to "". | str |
min | The minimum value allowed, eg. "0". Defaults to None. | float |
max | The maximum value allowed, eg. "100". Defaults to None. | float |
currency | The currency to display to the user, eg. "USD", "BRL, "EUR", "GBP". Defaults to "USD". | str |
disabled | whether the input is disabled. Defaults to False. | bool |
required | Whether the input is required or not eg. "this field is required". Defaults to True. | Union[bool, str] |
hint | A tooltip displayed to the user. Defaults to None. | str |
full_width | Whether the input should use full screen width. Defaults to False. | bool |
button_text | What text to display on the button when the widget is not part of a Page. Defaults to 'Next'. | str |
Return Values
Type | Description |
---|---|
float | The value entered by the user |