SolveItproblems

SolveITProblems is a project of QFormat.net intellectual club

SolveITProblems это проект интеллектуального клуба QFormat.net

четверг, 20 января 2011 г.

Java DecimalFormat (Formatting the numbers)

Formatting the numbers in Java its a problem which you can have when you operate with big or small numbers. For example, if you calculate some sum, you can see that after some amount you get something like 4.5376784E7 instead of  45376784. The solution is easy :







DecimalFormat dc = new DecimalFormat("#.##########");
System.out.println(dc.format(sum));

Many times you can fully build your project but forget about this... So keep in mind :) DecimalFormat is the solution....

Комментариев нет:

Отправка комментария