Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Colleen Burton   on Jan 16 In Java Category.

  
Question Answered By: Beaudi Smith   on Jan 16

for your first question, use the following.

If you want to round just use

> DecimalFormat:
> import java.text.DecimalFormat;
> public class Rounding {
> public static void main(String[] args) {
> DecimalFormat df = new DecimalFormat("#.00");
double  d = 9.99999999999;
> System.out.println(df.format(d));
> }
> }

Share: 

 

This Question has 11 more answer(s). View Complete Question Thread

 


Tagged: