定义 说明 %@ Objective-C object, printed as the string returned by descriptionWithLocale: if available, or description otherwise. Also works with CFTypeRef objects, returning the result of the CFCopyDescription function. %% ‘%’ character %d, %D, %i Signe
Java中数字的格式化输出 double d = 345.678; String s = "hello!"; int i = 1234; //"%"表示进行格式化输出,"%"之后的内容为格式的定义. System.out.printf("%f",d);//"f"表示格式化输出浮点数. System.out.printf("%9.2f",d);//"9.2"中的9表示输