[Android]格式化字串顯示到小數第一位

 double rtd=123.456;


小數第一位
String gg=String.format("%.1f", rtd)+" KG"


小數第二位
String.format("%.2", rtd)

留言

此網誌的熱門文章