#include <CNCL/FormFloat.h>
CN_FORMFLOAT
CNString
None
CNFormInt
This class converts doubles to CNStrings using different kinds of format styles provided by the stream-2.0-implementation. The current formats implemented in this class are 'left' and 'right' in connection with 'scientific', 'showpoint' or 'fixed'. Note: If the number is too long, the right part of it will be cut, no matter wich format style is chosen. If the number is cut (because of the chosen precision) it will be round. If the precision is not in the interval [0,16] problems with the accuracy might occur.
Constructors:
CNFormFloat();
CNFormFloat(CNParam *param);
CNFormFloat(double x, int w);
CNFormFloat(double x, int w, char fill);
CNFormFloat(double x, int w, char fill, int format);
CNFormFloat(double x, int w, char fill, int format, int pr);
FormFloat
with the value x (default = 0.0), the
width w (= 3), the fill character fill (= ' '), the format (= right) and
the precision pr (= 6).
The different formats implemented in CNFormFloat
are:
int right = 1
int left = 2
int scientific = 4
int showpoint = 8
int fixed = 16
In addition to the member functions required by CNCL, CNFormFloat
provides:
double get_value();
double value();
char get_fill();
char fill();
formats get_format();
formats format();
int get_width();
int width();
int get_precision();
int precision();
void set_value(double x);
void value(double x);
void set_fill(char f);
void fill(char f);
void set_format(formats f);
format(formats f);
void set_width(int w);
void width(int w);
void set_precision(int pr);
void precision(int pr);
Go to the first, previous, next, last section, table of contents.