Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Yes, it is possible to type in a decimal separator using both KeyboardType.Number and KeyboardType.Decimal in TextField.

When using KeyboardType.Decimal, the keyboard will show a decimal separator button. However, when using KeyboardType.Number, you can still type in a decimal separator by pressing the period (.) or comma (,) key depending on your device's regional settings.

For example, on a US keyboard, you would type a decimal separator using the period key. On a European keyboard, you would use the comma key.

You can also customize the decimal separator by setting the localization of the app to match the user's regional settings using the following code:

Locale.current.decimalSeparator

This will return the decimal separator character for the user's current locale.