private static String FormatAbstract(double value, string increment, double lowend, double halfway, double almost, bool future)
{
String abstraction = "";
if (value < (1 + lowend))
{
abstraction = "a " + increment + (future ? " from now" : " ago");
}
else if (value >= (1 + lowend) && value < (1 + halfway))
{
abstraction = "over a " + increment + (future ? " from now" : " ago");
}
else
{
double valuewhole = value - (value % 1);
double mod = (value % 1);
if (mod < lowend)
{
abstraction = valuewhole.ToString() + " " + increment + "s" + (future ? " from now" : " ago");
}
else if (mod >= lowend && mod < halfway)
{
abstraction = (future ? "more than " : "over ") + valuewhole.ToString() + " " + increment + "s" + (future ? " from now" : " ago");
}
else if (mod >= halfway && mod < almost)
{
abstraction = (future ? "about " : "almost ") + (valuewhole + 1).ToString() + " " + increment + "s" + (future ? " from now" : " ago");
}
else if (mod >= almost)
{
abstraction = (valuewhole + 1).ToString() + " " + increment + "s" + (future ? " from now" : " ago");
}
}
return abstraction;
}