hi i know this is a newb question, but how do i get doubles to display the end zeros after the decimal point for example i want to display 1.20 but i'm getting 1.2
cheers
hi i know this is a newb question, but how do i get doubles to display the end zeros after the decimal point for example i want to display 1.20 but i'm getting 1.2
cheers
Try NumberFormat and its derivatives.
Check the API docs for specifics.
More examples...
http://java.brangle.com/tutorials/java/text/DecimalFormat.php
import java.text.DecimalFormat;
DecimalFormat df = new DecimalFormat("###.00");
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.