I have this:
if (inKm)
{
text = String.valueOf(MetricConverter.milesToKilometers(Double.valueOf(text)));
}
This yields a result into a JTextField that is a bit too long for my liking. How do I truncate or use decimalformat on the resulting value? When I used decimalformat within this expression it just bugged out the program.