Skip to content

Commit

Permalink
Minor things
Browse files Browse the repository at this point in the history
  • Loading branch information
dieechtenilente committed Jul 13, 2017
1 parent 92ec483 commit 0e7a2b2
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.Locale;
import java.util.concurrent.TimeUnit;

import de.klaushackner.breathalyzer.R;
Expand Down Expand Up @@ -49,16 +50,16 @@ public View getView(int position, View convertView, @NonNull ViewGroup parent) {

Mixture m = d.getMixture();
if (d.getMixture().getAmount() < 100) {
name.setText(String.format("%.2f ml %s (%.2f %%)", m.getAmount(), m.getName(), m.getPercentage() * 100.0));
name.setText(String.format(Locale.GERMAN, "%.2g ml %s (%.2g %%)", m.getAmount(), m.getName(), m.getPercentage() * 100.0));
//name.setText(format.format(m.getAmount()) + " ml " + m.getName() + " (" + format.format(m.getPercentage() * 100) + " %)");
} else {
name.setText(String.format("%.2f l %s (%.2f %%)", m.getAmount() / 1000, m.getName(), m.getPercentage() * 100.0));
name.setText(String.format(Locale.GERMAN, "%.2g l %s (%.2g %%)", m.getAmount() / 1000, m.getName(), m.getPercentage() * 100.0));
//name.setText(format.format(m.getAmount() / 1000) + " l " + m.getName() + " (" + format.format(m.getPercentage() * 100) + " %)");
}

takingTime.setText(String.format("%02d:%02d", TimeUnit.MILLISECONDS.toHours(ago), TimeUnit.
takingTime.setText(String.format(Locale.GERMAN, "%02d:%02d", TimeUnit.MILLISECONDS.toHours(ago), TimeUnit.
MILLISECONDS.toMinutes(ago) % TimeUnit.HOURS.toMinutes(1)));
expireTime.setText(String.format("%02d:%02d", TimeUnit.MILLISECONDS.toHours(expires), TimeUnit.
expireTime.setText(String.format(Locale.GERMAN, "%02d:%02d", TimeUnit.MILLISECONDS.toHours(expires), TimeUnit.
MILLISECONDS.toMinutes(expires) % TimeUnit.HOURS.toMinutes(1)));

if (d.getMixture().getImage().compareTo("") != 0) {
Expand Down

0 comments on commit 0e7a2b2

Please sign in to comment.