Is there any way to set the precision of the result when converting a double to string using std::to_string()
?
Is there any way to set the precision of the result when converting a double to string using std::to_string()
?
No.
Returns: Each function returns a string object holding the character representation of the value of its argument that would be generated by calling
sprintf(buf, fmt, val)
with a format specifier of"%d"
,"%u"
,"%ld"
,"%lu"
,"%lld"
,"%llu"
,"%f"
,"%f"
, or"%Lf"
, respectively, where buf designates an internal character buffer of sufficient size.