mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-01-13 11:36:24 +00:00
Fixes for double.tryParse
This commit is contained in:
parent
40613c9c36
commit
f058cefad2
3 changed files with 5 additions and 6 deletions
|
|
@ -155,9 +155,8 @@ class QuantityField extends TextFormField {
|
|||
|
||||
if (value != null && value.isEmpty) return L10().quantityEmpty;
|
||||
|
||||
double quantity = double.tryParse(value ?? '0') ?? 0;
|
||||
double quantity = double.tryParse(value.toString()) ?? 0;
|
||||
|
||||
if (quantity == null) return L10().quantityInvalid;
|
||||
if (quantity <= 0) return L10().quantityPositive;
|
||||
if ((max != null) && (quantity > max)) return "Quantity must not exceed ${max}";
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue