Show mixed fractions instead of decimals for output
This commit is contained in:
@@ -26,8 +26,8 @@
|
|||||||
<MapFileExtensions>true</MapFileExtensions>
|
<MapFileExtensions>true</MapFileExtensions>
|
||||||
<ProductName>Cut List</ProductName>
|
<ProductName>Cut List</ProductName>
|
||||||
<PublisherName>Rogers Engineering</PublisherName>
|
<PublisherName>Rogers Engineering</PublisherName>
|
||||||
<ApplicationRevision>7</ApplicationRevision>
|
<ApplicationRevision>1</ApplicationRevision>
|
||||||
<ApplicationVersion>1.1.0.%2a</ApplicationVersion>
|
<ApplicationVersion>1.2.1.%2a</ApplicationVersion>
|
||||||
<UseApplicationTrust>false</UseApplicationTrust>
|
<UseApplicationTrust>false</UseApplicationTrust>
|
||||||
<PublishWizardCompleted>true</PublishWizardCompleted>
|
<PublishWizardCompleted>true</PublishWizardCompleted>
|
||||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||||
|
|||||||
@@ -59,12 +59,16 @@ namespace CutList.Forms
|
|||||||
var writer = new StreamWriter(file);
|
var writer = new StreamWriter(file);
|
||||||
writer.AutoFlush = true;
|
writer.AutoFlush = true;
|
||||||
|
|
||||||
var max = Bins.Max(b => b.Items.Max(i => ArchUnits.FormatFromInches(i.Length).Length));
|
var max = Bins.Max(b => b.Items.Max(i => SawCut.Helper.ConvertToMixedFraction(i.Length).Length));
|
||||||
var id = 1;
|
var id = 1;
|
||||||
|
|
||||||
foreach (var bin in Bins)
|
foreach (var bin in Bins)
|
||||||
{
|
{
|
||||||
var binDescription = $"{id++}. {bin}";
|
var totalLength = SawCut.Helper.ConvertToMixedFraction(bin.Length);
|
||||||
|
var remainingLength = SawCut.Helper.ConvertToMixedFraction(bin.RemainingLength);
|
||||||
|
var utilitation = Math.Round(bin.Utilization * 100, 2);
|
||||||
|
|
||||||
|
var binDescription = $"{id++}. Length: {{totalLength}}, {remainingLength} remaining, {bin.Items.Count} items, {utilitation}% utilization";
|
||||||
writer.WriteLine(binDescription);
|
writer.WriteLine(binDescription);
|
||||||
|
|
||||||
var groups = bin.Items.GroupBy(i => $"{i.Name} {i.Length}");
|
var groups = bin.Items.GroupBy(i => $"{i.Name} {i.Length}");
|
||||||
@@ -73,7 +77,7 @@ namespace CutList.Forms
|
|||||||
{
|
{
|
||||||
var first = group.First();
|
var first = group.First();
|
||||||
var count = group.Count();
|
var count = group.Count();
|
||||||
var length = ArchUnits.FormatFromInches(first.Length).ToString().PadLeft(max);
|
var length = SawCut.Helper.ConvertToMixedFraction(first.Length).PadLeft(max);
|
||||||
var name = first.Name;
|
var name = first.Name;
|
||||||
|
|
||||||
var pcsSingularOrPlural = count == 1 ? "pc " : "pcs";
|
var pcsSingularOrPlural = count == 1 ? "pc " : "pcs";
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Runtime.Remoting.Messaging;
|
||||||
|
|
||||||
namespace SawCut
|
namespace SawCut
|
||||||
{
|
{
|
||||||
@@ -47,8 +48,8 @@ namespace SawCut
|
|||||||
|
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
{
|
{
|
||||||
var totalLength = ArchUnits.FormatFromInches(Math.Round(Length, 4));
|
var totalLength = Helper.ConvertToMixedFraction(Math.Round(Length, 4));
|
||||||
var remainingLength = ArchUnits.FormatFromInches(Math.Round(RemainingLength, 4));
|
var remainingLength = Helper.ConvertToMixedFraction(Math.Round(RemainingLength, 4));
|
||||||
var utilitation = Math.Round(Utilization * 100, 2);
|
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