0
Can someone help me in what is going wrong in this code?
public class Conversor {
public static String getUnidades(long quantidade) {
return getUnidades((float) quantidade);
}
public static String getUnidades(int quantidade) {
return getUnidades((float) quantidade);
}
public static String getUnidades(float quantidade) {
quantidade = quantidade / 1024 / 1024;
return quantidade>=1024? (quantidade>=1024*1024?(("%.2f", quantidade /1024/1024) + "TB"):(("%.2f", quantidade/1024) + "GB")):(("%.2f", quantidade) + "MB");
}
}
It is a method to convert units!
An example of output you use and the expected result vs the obtained result helps.
– mutlei
I will edit, thanks for the tip It is a method to convert units!
– user115863