gridripper::util::FixedPointFormatter Class Reference

Utility class to format number is fixed point notation. More...

List of all members.

Public Member Functions

String format (double x, int width, int prec, boolean fsgn)
 Formats a double floating point number in fixed point notation.
String format (Object v, int width, int prec, boolean fsgn)
 Formats a number in fixed point notation.


Detailed Description

Utility class to format number is fixed point notation.

Version:
1.0, 05/01/2004
Since:
1.0, 05/01/2004
Author:
Peter Csizmadia

Member Function Documentation

String gridripper::util::FixedPointFormatter::format ( double  x,
int  width,
int  prec,
boolean  fsgn 
) [inline]

Formats a double floating point number in fixed point notation.

The number is right adjusted on the field boundary. Calling s = format(x, 10, 3, false) is equivalent to the C function call sprintf(s, "%10.3f", x), format(x, 10, 3, true) is equivalent to sprintf(s, "%+10.3f", x).

Parameters:
x the number
width the width of the field
prec precision, number of fraction digits
fsgn force writing the sign even if the number is positive
Returns:
the string representation

String gridripper::util::FixedPointFormatter::format ( Object  v,
int  width,
int  prec,
boolean  fsgn 
) [inline]

Formats a number in fixed point notation.

The number is right adjusted on the field boundary. Calling s = format(x, 10, 3, false) is equivalent to the C function call sprintf(s, "%10.3f", x), format(x, 10, 3, true) is equivalent to sprintf(s, "%+10.3f", x).

Parameters:
v the number (a Double, Float, Integer, Short, Long or Byte)
width the width of the field
prec precision, number of fraction digits
fsgn force writing the sign even if the number is positive
Returns:
the string representation


The documentation for this class was generated from the following file:

Generated on Wed Jun 17 18:47:30 2009 for GridRipper by  doxygen 1.5.6