MCPcopy Create free account
hub / github.com/covscript/covscript / numeric>

Method numeric>

include/covscript/impl/type_ext.hpp:485–496  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

483// To String
484 template <>
485 cs::string_borrower to_string<cs::numeric>(const cs::numeric &val)
486 {
487 if (!val.is_integer()) {
488 std::stringstream ss;
489 std::string str;
490 ss << std::setprecision(cs::current_process->output_precision) << val.as_float();
491 ss >> str;
492 return std::move(str);
493 }
494 else
495 return std::to_string(val.as_integer());
496 }
497
498 template <>
499 cs::string_borrower to_string<char>(const char &c)

Callers

nothing calls this directly

Calls 5

setprecisionFunction · 0.85
moveFunction · 0.50
to_stringFunction · 0.50
hashFunction · 0.50
numericFunction · 0.50

Tested by

no test coverage detected