If I have a double storing 10.0 what is the best way to convert it to string 10?
Currently I do:
if (object.getValue() > 9.999) {
someObject.setText(String.format("%d", new Double(object.getValue()).intValue()));
}
else {
//use amount as is
}
Update
These are class grade scores. I only care for a good coding style for checking out if a double is 10.0 and only then convert it to the string “10”. Don’t care about any other number