MCPcopy Create free account
hub / github.com/NeuralNetworkVerification/Marabou / convertDoubleToString

Method convertDoubleToString

src/proofs/JsonWriter.cpp:334–344  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

332}
333
334String JsonWriter::convertDoubleToString( double value )
335{
336 std::stringstream s;
337 s << std::fixed << std::setprecision( JSONWRITER_PRECISION ) << value;
338 String str = String( s.str() ).trimZerosFromRight();
339
340 // Add .0 for integers for some JSON parsers.
341 if ( !str.contains( "." ) )
342 str += String( ".0" );
343 return str;
344}
345
346String JsonWriter::convertDoubleArrayToString( const double *arr, unsigned size )
347{

Callers

nothing calls this directly

Calls 3

trimZerosFromRightMethod · 0.80
StringClass · 0.50
containsMethod · 0.45

Tested by

no test coverage detected