Advertisement
Ivakis

DecimalFormat

Oct 23rd, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. import java.text.DecimalFormat;
  2.  
  3. public class test {
  4. public static void main(String[] args) {
  5.  
  6.  
  7. DecimalFormat df = new DecimalFormat("#.#####"); // -> шаблон
  8.  
  9. System.out.println(df.format(2.5040250343)); // -> форматиране на дробно число
  10. }
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement