I use WTForms to display and validate form input. I use DecimalField to enter the amount of money, which works great when pasting a value with a dot as a delimiter with delimiters. Since this website will be used in continental Europe, I also want to allow the comma as a decimal separator. This means that both β2.5β and β2.5β should result in a value meaning βtwo and a halfβ.
When I enter a semicolon, I get the error message 'Not a valid decimal value' . How can I accept both periods and commas as decimal separators using WTForms?
I know that I can use Babel to use language-based number formatting, but I don't want that. I specifically want to accept both the period and the comma as the separator values.
source share