fix calcolo percentuali progress bar

This commit is contained in:
zaccaria.majid
2022-10-04 09:14:26 +02:00
parent b66f4fb239
commit 2d145a5e37
6 changed files with 14 additions and 9 deletions
@@ -16,9 +16,9 @@
}
else
{
<div>
<b><span class="class= @cssLast(@currRecord.Title)">@currRecord.Title</span></b>
<div class="col-6 pl-0 float-end">
<div class="d-flex justify-content-between">
<b><span class="@cssLast(@currRecord.Title) small">@currRecord.Title</span></b>
<div class="pl-0 float-end">
<div class="d-flex flex-column">
<div class="d-flex flex-row-reverse "><span class="float-end"><b>@currRecord.Value</b></span></div>
</div>
@@ -1,5 +1,6 @@
using Microsoft.AspNetCore.Components;
using MP.MONO.Core.DTO;
using System.Diagnostics.Tracing;
namespace MP.MONO.UI.Components
{
@@ -19,9 +20,13 @@ namespace MP.MONO.UI.Components
protected string percProgress(double num, double minVal, double maxVal)
{
string answ = "width: 0%;";
#if false
double den = (maxVal - minVal) != 0 ? (maxVal - minVal) : 1;
double ratio = ((double)num) / den;
answ = $"width: {ratio:P0};";
double ratio = ((double)num) / den;
#endif
int perc = (int)Math.Round(num,2);
answ = $"width: {perc}%;";
return answ;
}
protected string cssLast(string toolName)
+1 -1
View File
@@ -5,7 +5,7 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<Platforms>AnyCPU;x86;x64</Platforms>
<Version>1.2.2210.318</Version>
<Version>1.2.2210.408</Version>
</PropertyGroup>
<ItemGroup>
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>MAPO-MONO</i>
<h4>Version: 1.2.2210.318</h4>
<h4>Version: 1.2.2210.408</h4>
<br /> Release Note:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
1.2.2210.318
1.2.2210.408
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>1.2.2210.318</version>
<version>1.2.2210.408</version>
<url>http://nexus.steamware.net/repository/SWS/MP.MONO.UI/stable/LAST/MP.Mon.zip</url>
<changelog>http://nexus.steamware.net/repository/SWS/MP.MONO.UI/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>