You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nmWTAI-Platform/Include/nmNum/nmRender/nmNumericDisplayFormat.h

24 lines
987 B
C++

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#ifndef NMNUMERICDISPLAYFORMAT_H
#define NMNUMERICDISPLAYFORMAT_H
#include "nmRender_global.h"
#include <QString>
#include <QStringList>
#include <QVector>
/** @brief 后处理显式使用的数值文字工具;不换算单位、不改变原始 double。 */
class NM_RENDER_EXPORT nmNumericDisplayFormat
{
public:
/** @brief 普通值最多四位小数;极大、极小值使用四位有效数字的科学计数法。 */
static QString format(double dValue);
/** @brief 成组格式化;只对显示相同的不同有限值递增精度,最多十七位有效数字。 */
static QStringList formatDistinct(const QVector<double>& vecValues);
/** @brief 返回当前单位下可往返解析的十七位有效数字,供悬停查看。 */
static QString fullPrecision(double dValue);
/** @brief 兼容 Qt 4/VS2010 的有限值检查;NaN 和正负无穷均为 false。 */
static bool isFinite(double dValue);
};
#endif // NMNUMERICDISPLAYFORMAT_H