使用 DecimalFormat 对象的 format 方法来格式化数字。 使用 DecimalFormat时要确保格式模式字符串与所需的输出格式一致。 通过 DecimalFormat,你可以灵活地控制…