KSpread::ValueFormatter Class Reference
The ValueFormatter class generates a textual representation of data stored in a KSpreadValue, with a given formatting. More...
#include <valueformatter.h>
Collaboration diagram for KSpread::ValueFormatter:

Public Member Functions | |
ValueFormatter (ValueConverter *converter) | |
QString | formatText (KSpreadCell *cell, FormatType fmtType) |
QString | formatText (const KSpreadValue &value, FormatType fmtType, int precision=-1, KSpreadFormat::FloatFormat floatFormat=KSpreadFormat::OnlyNegSigned, const QString &prefix=QString::null, const QString &postfix=QString::null) |
QString | dateFormat (const QDate &_date, FormatType fmtType) |
QString | timeFormat (const QDateTime &_time, FormatType fmtType) |
Protected Member Functions | |
FormatType | determineFormatting (const KSpreadValue &value, FormatType fmtType) |
QString | createNumberFormat (double value, int precision, FormatType fmt, bool alwaysSigned) |
QString | fractionFormat (double value, FormatType fmtType) |
QString | errorFormat (KSpreadCell *cell) |
void | removeTrailingZeros (QString &str, QChar decimal_point) |
Protected Attributes | |
ValueConverter * | converter |
Detailed Description
The ValueFormatter class generates a textual representation of data stored in a KSpreadValue, with a given formatting.
Definition at line 40 of file valueformatter.h.
Constructor & Destructor Documentation
|
copnstructor
Definition at line 37 of file valueformatter.cc. |
Member Function Documentation
|
create a text representation of data in this cell
Definition at line 41 of file valueformatter.cc. References KSpreadCell::column(), KSpreadCell::hasError(), KSpreadCell::row(), and KSpreadCell::value(). Referenced by formatText(). |
|
create a text representation of data in this KSpreadValue
Definition at line 58 of file valueformatter.cc. References KSpreadValue::asDate(), KSpreadValue::asDateTime(), KSpread::ValueConverter::asFloat(), KSpreadValue::asFloat(), KSpread::ValueConverter::asString(), createNumberFormat(), dateFormat(), determineFormatting(), KSpreadValue::element(), formatText(), fractionFormat(), KSpreadValue::isArray(), KSpread::ValueConverter::locale(), removeTrailingZeros(), and timeFormat(). |
|
create a date format
Definition at line 486 of file valueformatter.cc. References KSpread::ValueConverter::locale(). Referenced by formatText(). |
|
create a time format
Definition at line 412 of file valueformatter.cc. References KSpread::ValueConverter::locale(). Referenced by formatText(). |
|
determine the formatting type that should be used to format this value in a cell with a given format type
Definition at line 128 of file valueformatter.cc. References KSpreadValue::asFloat(), KSpreadValue::format(), KSpreadValue::isBoolean(), and KSpreadValue::isString(). Referenced by formatText(). |
|
create a number format
Definition at line 231 of file valueformatter.cc. References KSpread::ValueConverter::locale(). Referenced by formatText(). |
|
create a fraction format
Definition at line 291 of file valueformatter.cc. Referenced by formatText(). |
|
Remove trailing zeros and the decimal point if necessary unless the number has no decimal point.
Definition at line 197 of file valueformatter.cc. References KSpread::ValueConverter::locale(). Referenced by formatText(). |
The documentation for this class was generated from the following files: