Explorar o código

Fixing sub-ingredient display on ingredient details.

Lee Morgan %!s(int64=5) %!d(string=hai) anos
pai
achega
cb890ec329
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      views/dashboardPage/js/classes/Ingredient.js

+ 4 - 1
views/dashboardPage/js/classes/Ingredient.js

@@ -19,7 +19,10 @@ class SubIngredient{
     }
 
     getDisplayQuantity(){
-        return `${this._quantity} ${this._ingredient.unit} / ${this._parent.quantity} ${this._parent.unit}`;
+        console.log(this._ingredient);
+        console.log(this._parent);
+        console.log(this._parent.unit);
+        return `${parseFloat(this._quantity.toFixed(2))} ${this.ingredient.unit} / ${this._parent.quantity} ${this._parent.unit}`;
     }
 }