[英]C++ Equivalent of %ld in Java for String.format()
For instance, %11.2lf
in C++ becomes %11.2f
in Java. 例如,
%11.2lf
在C ++变得%11.2f
在Java中。 How about for long format? 长格式怎么样?
Use %d
for decimals (long, int). 使用
%d
表示小数(long,int)。 It works OK. 它运作正常。 Eg:
例如:
System.err.println(String.format("%d", 193874120937489387L));
...will print just fine. ...打印就好了。 Read up on
java.util.Formatter
for more details. 阅读
java.util.Formatter
以获取更多详细信息。 %d
will take a long
, no problem. %d
需要很long
,没问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.