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