! \internal Returns the unicode string representing \a number as superscript. This is used to build unicode fractions in \ref unicodeFraction. */
| 6957 | unicode fractions in \ref unicodeFraction. |
| 6958 | */ |
| 6959 | QString QCPAxisTickerPi::unicodeSuperscript(int number) const |
| 6960 | { |
| 6961 | if (number == 0) |
| 6962 | return QString(QChar(0x2070)); |
| 6963 | |
| 6964 | QString result; |
| 6965 | while (number > 0) |
| 6966 | { |
| 6967 | const int digit = number%10; |
| 6968 | switch (digit) |
| 6969 | { |
| 6970 | case 1: { result.prepend(QChar(0x00B9)); break; } |
| 6971 | case 2: { result.prepend(QChar(0x00B2)); break; } |
| 6972 | case 3: { result.prepend(QChar(0x00B3)); break; } |
| 6973 | default: { result.prepend(QChar(0x2070+digit)); break; } |
| 6974 | } |
| 6975 | number /= 10; |
| 6976 | } |
| 6977 | return result; |
| 6978 | } |
| 6979 | |
| 6980 | /*! \internal |
| 6981 |
nothing calls this directly
no outgoing calls
no test coverage detected