Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

TxqSciNumberFormat Class Reference

TxqSciNumberFormat produces a string from a double using the requested TxqSciNumberPattern. More...

#include <TxqSciNumberFormat.h>

List of all members.

Public Methods

 TxqSciNumberFormat (TxqSciNumberPattern p)
 The constructor requires a SciNumberPattern. More...

 ~TxqSciNumberFormat ()
 The destructor does nothing. More...

QString format (double d)
 format does all the work of converting a double to the TxqSciNumberPattern format. More...


Private Attributes

TxqSciNumberPattern pattern
 The class data TxqSciNumberPattern from the constructor. More...


Detailed Description

TxqSciNumberFormat produces a string from a double using the requested TxqSciNumberPattern.

To make the task a bit easier, implementation makes use of TxqFloatingDecimal class which breaks a double down into usable components. Given a double value, TxqFloatingDecimal class provides the following data 1. indicates if value is NaN or infinite by setting isExceptional to true (not yet implemented) 2. indicates if value is negative 3. can retrieve all needed digits in a digit array called digits[] and interprets them as an integer 4. nDigits indicates the number of digits in digit array. So, for example, if we need these number of digits value = 123.456 digits[] = {'1','2','3','4','5','6'}; or value = 12345.6 digits[] = {'1','2','3','4','5','6'};

Definition at line 51 of file TxqSciNumberFormat.h.


Constructor & Destructor Documentation

TxqSciNumberFormat::TxqSciNumberFormat ( TxqSciNumberPattern p ) [inline]
 

The constructor requires a SciNumberPattern.

Parameters:
p   the TxqSciNumberPattern

Definition at line 60 of file TxqSciNumberFormat.h.

TxqSciNumberFormat::~TxqSciNumberFormat ( ) [inline]
 

The destructor does nothing.

Definition at line 68 of file TxqSciNumberFormat.h.


Member Function Documentation

QString TxqSciNumberFormat::format ( double d ) [inline]
 

format does all the work of converting a double to the TxqSciNumberPattern format.

Parameters:
d   the variable to format

Definition at line 75 of file TxqSciNumberFormat.h.


Member Data Documentation

TxqSciNumberPattern TxqSciNumberFormat::pattern [private]
 

The class data TxqSciNumberPattern from the constructor.

Definition at line 222 of file TxqSciNumberFormat.h.


The documentation for this class was generated from the following file: Copyright Tech-X Corporation, all rights reserved.