是否可以像在NumberFormat.format中那样在String.format调用中本地化数字?
我原以为它只是用它
String.format(locale, "%d", number)
Run Code Online (Sandbox Code Playgroud)
但是这不会返回与使用NumberFormat相同的结果.例如:
String.format(Locale.GERMAN, "%d", 1234567890)
Run Code Online (Sandbox Code Playgroud)
给出:"1234567890",而
NumberFormat.getNumberInstance(Locale.GERMAN).format(1234567890)
Run Code Online (Sandbox Code Playgroud)
给出:"1.234.567.890"
如果无法完成,那么本地化文本(包括数字)的推荐方法是什么?
如何获取当前执行的测试的状态?我想知道在 Dispose() 方法中当前测试是否失败。这应该类似于 mstest 的 TestContext.CurrentTestOutcome。