MCPcopy Create free account
hub / github.com/Kitware/VTK / fixZerosInTheEnd

Function fixZerosInTheEnd

ThirdParty/jsoncpp/vtkjsoncpp/jsoncpp.cpp:206–220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

204 */
205template <typename Iter>
206Iter fixZerosInTheEnd(Iter begin, Iter end, unsigned int precision) {
207 for (; begin != end; --end) {
208 if (*(end - 1) != '0') {
209 return end;
210 }
211 // Don't delete the last zero before the decimal point.
212 if (begin != (end - 1) && begin != (end - 2) && *(end - 2) == '.') {
213 if (precision) {
214 return end;
215 }
216 return end - 2;
217 }
218 }
219 return end;
220}
221
222} // namespace Json
223

Callers 1

valueToStringFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected