2020-08-31 04:03:41 +08:00
|
|
|
#ifndef UNIT_H
|
|
|
|
#define UNIT_H
|
|
|
|
|
|
|
|
#include <QString>
|
2021-05-14 21:05:22 +08:00
|
|
|
#include <complex>
|
2020-08-31 04:03:41 +08:00
|
|
|
|
2020-11-22 07:41:42 +08:00
|
|
|
namespace Unit
|
2020-08-31 04:03:41 +08:00
|
|
|
{
|
2020-11-22 07:41:42 +08:00
|
|
|
double FromString(QString string, QString unit = QString(), QString prefixes = " ");
|
2020-11-22 21:38:52 +08:00
|
|
|
// prefixed need to be in ascending order (e.g. "m kMG" is okay, whjle "MkG" does not work)
|
2020-11-22 07:41:42 +08:00
|
|
|
QString ToString(double value, QString unit = QString(), QString prefixes = " ", int precision = 6);
|
|
|
|
double SIPrefixToFactor(char prefix);
|
2020-08-31 04:03:41 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // UNIT_H
|