package com.laxture.lib.util;

import java.text.DecimalFormat;

public class NumberUtil {

    public static String format(int num, String pattern) {
        return new DecimalFormat(pattern).format(num);
    }

    public static String format(long num, String pattern) {
        return new DecimalFormat(pattern).format(num);
    }

    public static String format(double num, String pattern) {
        return new DecimalFormat(pattern).format(num);
    }

    public static String format(float num, String pattern) {
        return new DecimalFormat(pattern).format(num);
    }

    public static int parseInt(String text) {
        try {
            return Integer.parseInt(text);
        } catch (Exception ignored) {}
        return 0;
    }

}

@@ -741,10 +741,515 @@
 %0A    %7D%0A%0A
+    public static long parseLong(String text) %7B%0A        try %7B%0A            return Long.parseLong(text);%0A        %7D catch (Exception ignored) %7B%7D%0A        return 0;%0A    %7D%0A%0A    public static short parseShort(String text) %7B%0A        try %7B%0A            return Short.parseShort(text);%0A        %7D catch (Exception ignored) %7B%7D%0A        return 0;%0A    %7D%0A%0A    public static byte parseByte(String text) %7B%0A        try %7B%0A            return Byte.parseByte(text);%0A        %7D catch (Exception ignored) %7B%7D%0A        return 0;%0A    %7D%0A%0A
 %7D%0A

Add more NumberUtil.parse method