add comment for a specification of this code

This commit is contained in:
Francesco Lorenzo D'Amico
2025-05-27 13:47:51 +02:00
parent f2bb057a9b
commit 5c9f6c8120
2 changed files with 2 additions and 3 deletions
@@ -1,11 +1,8 @@
// <auto-generated /> // <auto-generated />
using System;
using Francesco.Recipes.World.Data; using Francesco.Recipes.World.Data;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable #nullable disable
@@ -123,6 +123,8 @@
finalQuantity = Math.round(adjustedQuantity); finalQuantity = Math.round(adjustedQuantity);
} }
} }
// Convert small unit "msp" (pinch) to teaspoons (TL) for a better estimate
// 4 pinches = about 1 TL → show that as a note, rounded to 1 decimal
else if (specialUnits.smallUnits.includes(unitSymbol)) { else if (specialUnits.smallUnits.includes(unitSymbol)) {
if (adjustedQuantity > 3) { if (adjustedQuantity > 3) {
finalQuantity = Math.round(adjustedQuantity / 4 * 10) / 10; finalQuantity = Math.round(adjustedQuantity / 4 * 10) / 10;