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