English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

int area = 2;
System.out.print(Format.right(area, 2, 5));

2006-06-08 10:47:45 · 2 answers · asked by a_normal_grl 1 in Computers & Internet Programming & Design

2 answers

Hi, there is no such thing of format... I think you meant Math. .. or some similar.

I have checked the Java API and there was no such thing of Format that has right.

http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html

There is Formatter, etca

Good luck

2006-06-08 11:40:59 · answer #1 · answered by ? 6 · 0 1

There is a class Format, it is in java.text This class is abstract, meaning you have to make a superclass from it to get it to work. As far as the method 'right', there is none on the abstract class, but that does not mean it could not be implemented in your Format class.

My suggestion as to what it would display, and this depends on how the method 'right' is written, is the area, being 2, with 2 decimal points, and taking a maximum of 5 spaces.

Ie, _2.00 with '_' being a blank space

2006-06-13 15:14:46 · answer #2 · answered by Mark aka jack573 7 · 0 0

fedest.com, questions and answers