More work on Formatter; successful tests.
This commit is contained in:
@ -111,12 +111,35 @@ namespace zaaReloaded2.Formatter
|
||||
reference = String.Empty;
|
||||
}
|
||||
|
||||
string unit;
|
||||
if (LabItem.HasUnit)
|
||||
{
|
||||
unit = String.Format(" {0}", LabItem.Unit);
|
||||
}
|
||||
else
|
||||
{
|
||||
unit = String.Empty;
|
||||
}
|
||||
|
||||
string value;
|
||||
if (LabItem.IsNumerical)
|
||||
{
|
||||
// Format the numerical value; this will convert
|
||||
// decimal points to commas as needed.
|
||||
value = String.Format("{0}", LabItem.NumericalValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
value = LabItem.Value;
|
||||
}
|
||||
|
||||
// Insert the formatted text into the document.
|
||||
document.Range().InsertAfter(
|
||||
String.Format(
|
||||
"{0} {1}{2}",
|
||||
"{0} {1}{2}{3}",
|
||||
LabItem.QualifiedName,
|
||||
LabItem.Value,
|
||||
value,
|
||||
unit,
|
||||
reference
|
||||
));
|
||||
HasBeenUsed = true;
|
||||
|
Reference in New Issue
Block a user