diff --git a/app/src/main/java/org/foxarmy/barcodescannerforemployees/views/ProductView.kt b/app/src/main/java/org/foxarmy/barcodescannerforemployees/views/ProductView.kt index 1e88960..936784e 100644 --- a/app/src/main/java/org/foxarmy/barcodescannerforemployees/views/ProductView.kt +++ b/app/src/main/java/org/foxarmy/barcodescannerforemployees/views/ProductView.kt @@ -103,7 +103,7 @@ class ProductView: LinearLayout { productCategoryView.text = DBStorageController(activity).getCategoryNameById(DBStorageController(activity).readableDatabase, linkedAbstractProduct.category) productLifeSpan.text = "${SimpleDateFormat("dd.MM.yyyy").format(Date(product.dateOfProduction*1000))}-${SimpleDateFormat("dd.MM.yyyy").format(Date(product.dateOfExpiry*1000))}" productFreshnessTextView.text = - if (product.freshness == Double.NEGATIVE_INFINITY || product.freshness == Double.POSITIVE_INFINITY) { + if (product.freshness == Double.NEGATIVE_INFINITY || product.freshness == Double.POSITIVE_INFINITY || product.freshness < 0) { "Expired" } else { "${DecimalFormat("#.#").format(product.freshness*100)}%"