Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 7th, 2012  |  syntax: None  |  size: 0.28 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. toast output, float decimal formatting?
  2. DecimalFormat var = new DecimalFormat("#.###");
  3. Toast.makeText(this,"number equals"+var.format(number),Toast.LENGTH_SHORT).show();
  4.        
  5. float number = (float)Math.round(oldNumber * 1000) / 1000;
  6. string formattedNumber = Float.toString(number);