---
title: "Java浮点型数据控制精度DecimalFormat"
author: "Soft_Development"
date: "2012-02-22T17:17:08Z"
tags: []
categories: ["编程语言"]
slug: "java-decimalformat"
draft: false
lastmod: "2012-02-22T17:17:08Z"
id: 1418256
url: "https://soft-development.iteye.com/blog/1418256"
---

```
可以用以下的类：
java.text.DecimalFormat df=new java.text.DecimalFormat( "#.## "); 
String tem = df.format(3.1415);

 
```