Fill prescription block by columns, not rows.

This commit is contained in:
Daniel Kraus 2015-12-01 20:51:24 +01:00
parent 6ec282ee68
commit def5fce235
1 changed files with 4 additions and 3 deletions

View File

@ -77,12 +77,13 @@ namespace zaaReloaded2.Medication
document,
writer =>
{
for (int i = 0; i < Prescriptions.Count; i += 2)
int half = Prescriptions.Count / 2 + Prescriptions.Count % 2;
for (int i = 0; i < half; i++)
{
writer.Write(Prescriptions[i].ToString());
if (i + 1 < Prescriptions.Count)
if (i + half < Prescriptions.Count)
{
writer.Write("\t" + Prescriptions[i+1].ToString());
writer.Write("\t" + Prescriptions[i + half].ToString());
}
writer.WriteLine();
}