snn*_*nth 19 java string formatting printf string-formatting
这基本上就是我想要做的
// ... some code, calculations, what have you ...
long timeToAdd = returnTimeToAddInLongFormat();
// lets output the long type now, and yes i need the width and precision.
System.out.printf("Time to add: %13.10ld", timeToAdd);
Run Code Online (Sandbox Code Playgroud)
我已经阅读了围绕这个主题的大部分谷歌搜索,并认为我理解如何在概念上做到这一点,但JRE不断抛弃我UnknownFormatConversionException并告诉我我的输入大小修改器l不起作用.
还有另一种方法可以做到这一点,还是我想念一些小事?