15#ifndef QGSFRACTIONNUMERICFORMAT_H
16#define QGSFRACTIONNUMERICFORMAT_H
40 QString
id()
const override;
134 sign = value < 0 ? -1 : 1;
135 double g = std::fabs( value );
136 unsigned long long a = 0;
137 unsigned long long b = 1;
138 unsigned long long c = 1;
139 unsigned long long d = 0;
140 unsigned long long s;
141 unsigned int iteration = 0;
145 numerator = a + s *
c;
146 denominator = b + s * d;
152 if (
qgsDoubleNear(
static_cast< double >( sign )*
static_cast< double >( numerator ) / denominator, value, tolerance ) )
157 while ( iteration++ < 100 );
165 static QString toUnicodeSuperscript(
const QString &input );
171 static QString toUnicodeSubscript(
const QString &input );
178 virtual void setConfiguration(
const QVariantMap &configuration,
const QgsReadWriteContext &context );
182 bool mUseDedicatedUnicode =
false;
183 bool mUseUnicodeSuperSubscript =
true;
184 bool mShowThousandsSeparator =
true;
185 bool mShowPlusSign =
false;
186 QChar mThousandsSeparator;
A context for numeric formats.
A container for the context for various read/write operations on objects.
As part of the API refactoring and improvements which landed in the Processing API was substantially reworked from the x version This was done in order to allow much of the underlying Processing framework to be ported into c
bool qgsDoubleNear(double a, double b, double epsilon=4 *std::numeric_limits< double >::epsilon())
Compare two doubles (but allow some difference).