How do I limit the number of numbers shown to 3 after the decimal instead of it spazzing beyond the interface.
[Only registered and activated users can see links. Click Here To Register...]
Printable View
How do I limit the number of numbers shown to 3 after the decimal instead of it spazzing beyond the interface.
[Only registered and activated users can see links. Click Here To Register...]
Add a new Decimal Format.
DecimalFormat format = new DecimalFormat("#.##");
You'll also need to add this import:
import java.text.DecimalFormat;
You just lost me, lol.Quote:
Originally Posted by Admiral [Only registered and activated users can see links. Click Here To Register...]
Code:if (kills == 0 && deaths == 0) {
this.getFrames().sendString("<col=6DA829>K/D Ratio: <col=FFFFFF>0", 259, 32);
} else {
this.getFrames().sendString("<col=6DA829>K/D Ratio: <col=FFFFFF>"+KDR+"", 259, 32);
}
NumberFormat.getIntegerInstance().format(KDR);
That only shows 1, 2, 3, etc. I want the decimals but I don't want them as long. I only want like 3.28 instead of 3.2883443435465Quote:
Originally Posted by Tyluur [Only registered and activated users can see links. Click Here To Register...]
String#substring