Guest User

Untitled

a guest
Mar 22nd, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. function[xr]=rounder(x,n)
  2.  
  3. DecimalFormat df = new DecimalFormat("#.####");
  4. df.setRoundingMode(RoundingMode.CEILING);
  5. for (Number n : Arrays.asList(12, 123.12345, 0.23, 0.1, 2341234.212431324)) {
  6. Double d = n.doubleValue();
  7. System.out.println(df.format(d));
  8. }
Add Comment
Please, Sign In to add comment