15#ifndef QGSFRACTIONNUMERICFORMAT_H
16#define QGSFRACTIONNUMERICFORMAT_H
39 QString
id()
const override;
133 sign = value < 0 ? -1 : 1;
134 double g = std::fabs( value );
135 unsigned long long a = 0;
136 unsigned long long b = 1;
137 unsigned long long c = 1;
138 unsigned long long d = 0;
139 unsigned long long s;
140 unsigned int iteration = 0;
144 numerator = a + s *
c;
145 denominator = b + s * d;
151 if (
qgsDoubleNear(
static_cast< double >( sign ) *
static_cast< double >( numerator ) / denominator, value, tolerance ) )
155 }
while ( iteration++ < 100 );
163 static QString toUnicodeSuperscript(
const QString &input );
169 static QString toUnicodeSubscript(
const QString &input );
175 virtual void setConfiguration(
const QVariantMap &configuration,
const QgsReadWriteContext &context );
178 bool mUseDedicatedUnicode =
false;
179 bool mUseUnicodeSuperSubscript =
true;
180 bool mShowThousandsSeparator =
true;
181 bool mShowPlusSign =
false;
182 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).