| 26 | namespace { |
| 27 | |
| 28 | QString evalString(const MoveEvaluation& eval) |
| 29 | { |
| 30 | if (eval.isBookEval()) |
| 31 | return "book"; |
| 32 | if (eval.isEmpty()) |
| 33 | return QString(); |
| 34 | |
| 35 | QString str = eval.scoreText(); |
| 36 | if (eval.depth() > 0) |
| 37 | str += "/" + QString::number(eval.depth()) + " "; |
| 38 | |
| 39 | int t = eval.time(); |
| 40 | if (t == 0) |
| 41 | return str + "0s"; |
| 42 | |
| 43 | int precision = 0; |
| 44 | if (t < 100) |
| 45 | precision = 3; |
| 46 | else if (t < 1000) |
| 47 | precision = 2; |
| 48 | else if (t < 10000) |
| 49 | precision = 1; |
| 50 | str += QString::number(double(t / 1000.0), 'f', precision) + 's'; |
| 51 | |
| 52 | return str; |
| 53 | } |
| 54 | |
| 55 | } // anonymous namespace |
| 56 |
no test coverage detected