snippet-library
snippet-library copied to clipboard
Fix validation error for the decimal quantity field
trafficstars
Fix validation error for the decimal quantity field when the value starts with the decimal sign (dot/comma).
As can be seen in the screenshot below, form validation fails for a value like .2 - which is a valid value - even when the total is correctly calculated. This is quite inconsistent.
Code formatting/refactoring was also done for some parts of the existing code in order to provide clarity and reduce repetitions e.g. the GFCommon::is_numeric method was used 4 times in the old code but just twice in the new code.
Context
⛑️ Ticket(s): https://secure.helpscout.net/link/to/conversation
📓 Notion: https://notion.so/link/to/card
💬 Slack: https://slack.com/link/to/thread-or-message