MCPcopy Create free account
hub / github.com/Audio4Linux/JDSP4Linux / unicodeSuperscript

Method unicodeSuperscript

3rdparty/qcustomplot/qcustomplot.cpp:7650–7669  ·  view source on GitHub ↗

! \internal Returns the unicode string representing \a number as superscript. This is used to build unicode fractions in \ref unicodeFraction. */

Source from the content-addressed store, hash-verified

7648 unicode fractions in \ref unicodeFraction.
7649*/
7650QString QCPAxisTickerPi::unicodeSuperscript(int number) const
7651{
7652 if (number == 0)
7653 return QString(QChar(0x2070));
7654
7655 QString result;
7656 while (number > 0)
7657 {
7658 const int digit = number%10;
7659 switch (digit)
7660 {
7661 case 1: { result.prepend(QChar(0x00B9)); break; }
7662 case 2: { result.prepend(QChar(0x00B2)); break; }
7663 case 3: { result.prepend(QChar(0x00B3)); break; }
7664 default: { result.prepend(QChar(0x2070+digit)); break; }
7665 }
7666 number /= 10;
7667 }
7668 return result;
7669}
7670
7671/*! \internal
7672

Callers

nothing calls this directly

Calls 1

QStringClass · 0.50

Tested by

no test coverage detected