Posted by: piman007 | 10-05-2007

MessageFormat

   
    public String number(String strValue,String strFormat){
        // 0000000000
        // #,###.00
        // #,###.##       
        MessageFormat mf = new MessageFormat("{0,number,"+strFormat+"}");
        Object[] objs = {new Double(Double.parseDouble(strValue))};
        String result = mf.format(objs);
        return result;
    }

ใส่ความเห็น

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / เปลี่ยนแปลง )

Twitter picture

You are commenting using your Twitter account. Log Out / เปลี่ยนแปลง )

Facebook photo

You are commenting using your Facebook account. Log Out / เปลี่ยนแปลง )

Google+ photo

You are commenting using your Google+ account. Log Out / เปลี่ยนแปลง )

Connecting to %s

หมวดหมู่

%d bloggers like this: