mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-08-05 21:45:25 +02:00
fix: increased float rounding precision for CRF parser (#1369)
* increased float rounding precision for crf parser * limited fractions to a max denominator of 32 to prevent weirdly specific values * add test cases for 1/8 and 1/32 * add rounding to avoid more digits than necessary Co-authored-by: Hayden <64056131+hay-kot@users.noreply.github.com>
This commit is contained in:
parent
504bf41b9c
commit
b904b161eb
4 changed files with 9 additions and 5 deletions
|
@ -74,7 +74,7 @@ class RecipeIngredient(MealieModel):
|
|||
empty string.
|
||||
"""
|
||||
if isinstance(value, float):
|
||||
return value
|
||||
return round(value, 3)
|
||||
if value is None or value == "":
|
||||
return None
|
||||
return value
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue