| 769 | } |
| 770 | |
| 771 | std::string DoubleToString(double dd, short decimals, bool trim_right_zeros) { |
| 772 | char xx[44]; |
| 773 | int cnt = snprintf(xx, 44, "%.*f", decimals, dd); |
| 774 | if (trim_right_zeros) { |
| 775 | while ((cnt > 0) && ((xx[cnt - 1] == '0') || (xx[cnt - 1] == '.'))) { |
| 776 | xx[cnt - 1] = '\0'; |
| 777 | cnt--; |
| 778 | } |
| 779 | } |
| 780 | return xx; |
| 781 | } |
| 782 | |
| 783 | std::string CcToUnderline(const std::string& in) { |
| 784 | std::string res; |
no outgoing calls
no test coverage detected