mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-08-03 04:25:24 +02:00
fix: round ingredient amounts when not using fractions (#4470)
This commit is contained in:
parent
2b2bc041bd
commit
985b5634b7
1 changed files with 1 additions and 1 deletions
|
@ -54,7 +54,7 @@ export function useParsedIngredientText(ingredient: RecipeIngredient, disableAmo
|
|||
// casting to number is required as sometimes quantity is a string
|
||||
if (quantity && Number(quantity) !== 0) {
|
||||
if (unit && !unit.fraction) {
|
||||
returnQty = (quantity * scale).toString();
|
||||
returnQty = Number((quantity * scale).toPrecision(3)).toString();
|
||||
} else {
|
||||
const fraction = frac(quantity * scale, 10, true);
|
||||
if (fraction[0] !== undefined && fraction[0] > 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue