src/main/java/com/github/klikli_dev/occultism/util/TextUtil.java
/**
     * Formats the given number for human friendly display.
     * Rounds high numbers.
     *
     * @param number the number to format.
     * @return a formatted string for the number.
     */
Formats the given number for human friendly display.
Rounds high numbers.

@param number the number to format.
@return a formatted string for the number.
Formats the given number for human friendly display . Rounds high numbers . @param number the number to format . @return a formatted string for the number .
public static String formatLargeNumber(int number) {
        if (number < Math.pow(10, 3)) {
            return number + "";
        } else if (number < Math.pow(10, 6)) {
            int rounded = Math.round(number / 1000.0F);
            return rounded + "K";
        } else if (number < Math.pow(10, 9)) {
            int rounded = Math.round(number / (float) Math.pow(10, 6));
            return rounded + "M";
        } else if (number < Math.pow(10, 12)) {
            int rounded = Math.round(number / (float) Math.pow(10, 9));
            return rounded + "B";
        }
        return Integer.toString(number);
    }
public static String formatLargeNumber ( int number ) { if ( number < Math . pow ( 10 , 3 ) ) { return number + "" ; } else if ( number < Math . pow ( 10 , 6 ) ) { int rounded = Math . round ( number / 1000.0F ) ; return rounded + "K" ; } else if ( number < Math . pow ( 10 , 9 ) ) { int rounded = Math . round ( number / ( float ) Math . pow ( 10 , 6 ) ) ; return rounded + "M" ; } else if ( number < Math . pow ( 10 , 12 ) ) { int rounded = Math . round ( number / ( float ) Math . pow ( 10 , 9 ) ) ; return rounded + "B" ; } return Integer . toString ( number ) ; }
Formats the given number for human friendly display.
Formats the given number for human friendly display .