MCPcopy Create free account
hub / github.com/Icinga/icinga2 / removeZero

Function removeZero

plugins/thresholds.cpp:149–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147}
148
149std::wstring removeZero(double val)
150{
151 std::wstring ret = boost::lexical_cast<std::wstring>(val);
152 std::wstring::size_type pos = ret.length();
153 if (ret.find_first_of(L".") == std::string::npos)
154 return ret;
155 for (std::wstring::reverse_iterator rit = ret.rbegin(); rit != ret.rend(); ++rit) {
156 if (*rit == L'.') {
157 return ret.substr(0, pos - 1);
158 }
159 if (*rit != L'0') {
160 return ret.substr(0, pos);
161 }
162 pos--;
163 }
164 return L"0";
165}
166
167std::vector<std::wstring> splitMultiOptions(const std::wstring& str)
168{

Callers 3

printOutputFunction · 0.85
pStringMethod · 0.85
printOutputFunction · 0.85

Calls 1

rendMethod · 0.80

Tested by

no test coverage detected