You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
725 B
C#

using System;
using System.Text;
namespace BunyMuny {
public class Statement {
public DateTime Date;
private string _description;
public string Description {
get => string.IsNullOrWhiteSpace(_description) ? OriginalDescription : _description;
set => _description = value;
}
public string OriginalDescription;
public decimal Value;
public string Category;
public override string ToString() {
// e.g.: Debit: $5.00 --> Lynnear Software (Personal) on Apr 2 2020
return String.Format(
"{0} ${1:F2} {2} {3} ({4}) on {5:MMM d yyyy}",
Value < 0 ? "Credit:" : "Debit: ",
Math.Abs(Value),
Value < 0 ? "-->" : "<--",
Description,
Category ?? "Unknown",
Date
);
}
}
}