mirror of
https://github.com/array-in-a-matrix/foodie.git
synced 2024-06-16 03:17:02 -04:00
foxed
This commit is contained in:
parent
82c84e97b5
commit
f1484dc01f
|
@ -12,9 +12,9 @@ function FoodMeter({percentage}) {
|
|||
const wasted = useContext(RecipeList).wastedIngredients;
|
||||
const total = useContext(RecipeList).totalIngredients;
|
||||
|
||||
var percentageupdated = (total-wasted)/total;
|
||||
var percentageupdated = Math.round(100* ((total-wasted)/total))/100;
|
||||
useEffect(() => {
|
||||
percentageupdated = (total-wasted)/total;
|
||||
percentageupdated = Math.round(100* ((total-wasted)/total))/100;
|
||||
console.log("percentage waste", percentageupdated);
|
||||
}, [wasted, total]);
|
||||
|
||||
|
|
Loading…
Reference in a new issue