[英]Java equivalent of: String.format(“{0:D9}”, Result);
Does anyone know the Java equivalent of the C# format of:有谁知道 Java 等效于 C# 格式:
String.format("{0:D9}", Result);
Here what it does: http://www.java2s.com/Code/CSharp/Data-Types/doublenumberformat0C0D90E0F30N0X0x.htm它的作用是: http://www.java2s.com/Code/CSharp/Data-Types/doublenumberformat0C0D90E0F30N0X0x.htm
This little problem is killin' me...这个小问题要了我的命...
As far as I understand the documentation D9
means "format as a decimal number with at least 9 digits, left-padding with 0 if necessary).据我了解,文档D9
的意思是“格式为至少有 9 位的十进制数,如有必要,用 0 左填充)。
The equivalent in Java format Strings would be %09d
: Java 格式字符串中的等效项为%09d
:
System.out.println(String.format("%09d", 1234));
This prints这打印
000001234
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.