Java BigDecimal

  • + 0 comments

    Java 8+

    s = Arrays.stream(s)
                .limit(n)
                .sorted((a, b) -> new BigDecimal(b).compareTo(new BigDecimal(a)))
                .toArray(String[]::new);