vipratech.util
Class DecimalPlaces
java.lang.Object
|
+--vipratech.util.DecimalPlaces
- public class DecimalPlaces
- extends java.lang.Object
- implements java.io.Serializable
The DecimalPlaces class is used to manage the display of numbers in a graphical user interface,GUI.
A number is sent to the class as an argument of the round(double data) method and the number of decimal
places to be displayed is set using the setDecimalPlaces(int dp) accessor method.
A string representing the
fomatted number is returned to be displayed.
- Version:
- 1.02, March 11, 2001
- Author:
- Warwick Bailey
warwick-bailey@bigfoot.com
- See Also:
- Serialized Form
Method Summary |
java.lang.String |
round(double data)
Returns a string representation of the number rounded to the set number of decimal places. |
void |
setDecimalPlaces(int dp)
Sets the number of decimal places to round to. |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
DecimalPlaces
public DecimalPlaces()
round
public final java.lang.String round(double data)
- Returns a string representation of the number rounded to the set number of decimal places.
By default, the class returns the number rounded to one decimal place.
setDecimalPlaces
public final void setDecimalPlaces(int dp)
- Sets the number of decimal places to round to.
http://leipzig.vernetztes-studium.de