使用String.format()或DecimalFormat(推荐)适用于格式化输出(如显示给用户),但返回的是字符串类型,示例代码:doublenum=3.4567;//使用String.format()Stringf...