Skip to content

Commit

Permalink
Merge pull request #715 from bcgov/706-calculate
Browse files Browse the repository at this point in the history
fix(frontend)[NMP-706]: Calculation Fixes to Fertigation Modal
  • Loading branch information
lunamoonmoon authored Dec 20, 2024
2 parents 9200d97 + c200984 commit 31d91e6
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions app/Server/src/SERVERAPI/Controllers/NutrientsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1016,14 +1016,15 @@ private void SolidFertigationCalculation(FertigationDetailsViewModel fgvm){

fertArea = Convert.ToDecimal(fgvm.fieldArea);

fgvm.nutrientConcentrationN = Convert.ToString(Math.Round(amountToDissolve * Convert.ToDecimal(fgvm.valN) / 100 / tankVolume, 2));
fgvm.nutrientConcentrationK2O = Convert.ToString(Math.Round(amountToDissolve * Convert.ToDecimal(fgvm.valK2o) / 100 / tankVolume, 2));
fgvm.nutrientConcentrationP205 = Convert.ToString(Math.Round(amountToDissolve * Convert.ToDecimal(fgvm.valP2o5) / 100 / tankVolume, 2));
//Need in lb/us gallon
fgvm.nutrientConcentrationN = Convert.ToString(Math.Round(amountToDissolve * Convert.ToDecimal(fgvm.valN) / 100 / (tankVolume * 1.20095m), 2));
fgvm.nutrientConcentrationK2O = Convert.ToString(Math.Round(amountToDissolve * Convert.ToDecimal(fgvm.valK2o) / 100 / (tankVolume * 1.20095m), 2));
fgvm.nutrientConcentrationP205 = Convert.ToString(Math.Round(amountToDissolve * Convert.ToDecimal(fgvm.valP2o5) / 100 / (tankVolume * 1.20095m), 2));

decimal injectionRate = Convert.ToDecimal(fgvm.injectionRate);
fgvm.fertigationTime = Math.Round(Convert.ToDecimal(fgvm.tankVolume) / injectionRate, 0);

if (amountToDissolve <= tankVolume * solInWater){
if (amountToDissolve <= tankVolume * solInWater/1000){
fgvm.dryAction = "Soluble";
}
else{
Expand Down

0 comments on commit 31d91e6

Please sign in to comment.