Display lengths in feet and inches
This commit is contained in:
@@ -79,7 +79,7 @@ namespace CutList.Forms
|
||||
var writer = new StreamWriter(file);
|
||||
writer.AutoFlush = true;
|
||||
|
||||
var max = Bins.Max(b => b.Items.Max(i => i.Length.ToString().Length));
|
||||
var max = Bins.Max(b => b.Items.Max(i => ArchUnits.FormatFromInches(i.Length).Length));
|
||||
var id = 1;
|
||||
|
||||
foreach (var bin in Bins)
|
||||
@@ -92,16 +92,16 @@ namespace CutList.Forms
|
||||
{
|
||||
var first = group.First();
|
||||
var count = group.Count();
|
||||
var length = first.Length.ToString().PadLeft(max);
|
||||
var length = ArchUnits.FormatFromInches(first.Length).ToString().PadLeft(max);
|
||||
var name = first.Name;
|
||||
|
||||
var pcsSingularOrPlural = count == 1 ? "pc " : "pcs";
|
||||
|
||||
writer.WriteLine($" {count}{pcsSingularOrPlural} @ {length}\" LG Tag:{name}");
|
||||
writer.WriteLine($" {count}{pcsSingularOrPlural} @ {length} LG Tag: {name}");
|
||||
}
|
||||
|
||||
writer.WriteLine("---------------------------------------------------------------------");
|
||||
writer.WriteLine();
|
||||
//writer.WriteLine();
|
||||
}
|
||||
|
||||
writer.Close();
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace SawCut
|
||||
|
||||
if (feet > 0)
|
||||
{
|
||||
return $"{feet}' {inches}\"";
|
||||
return $"{feet}'-{inches}\"";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -38,11 +38,11 @@ namespace SawCut
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
var totalLength = Math.Round(Length, 4);
|
||||
var remainingLength = Math.Round(RemainingLength, 4);
|
||||
var totalLength = ArchUnits.FormatFromInches(Math.Round(Length, 4));
|
||||
var remainingLength = ArchUnits.FormatFromInches(Math.Round(RemainingLength, 4));
|
||||
var utilitation = Math.Round(Utilization * 100, 2);
|
||||
|
||||
return $"Length: {totalLength}\", {remainingLength}\" remaining, {Items.Count} items, {utilitation}% utilization";
|
||||
return $"Length: {totalLength}, {remainingLength} remaining, {Items.Count} items, {utilitation}% utilization";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user