MCPcopy Create free account
hub / github.com/WinMerge/winmerge / floatToFixedStr

Function floatToFixedStr

Externals/poco/Foundation/src/NumericString.cpp:179–189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

177
178
179void floatToFixedStr(char* buffer, int bufferSize, float value, int precision)
180{
181 using namespace double_conversion;
182
183 StringBuilder builder(buffer, bufferSize);
184 int flags = DoubleToStringConverter::UNIQUE_ZERO |
185 DoubleToStringConverter::EMIT_POSITIVE_EXPONENT_SIGN;
186 DoubleToStringConverter dc(flags, POCO_FLT_INF, POCO_FLT_NAN, POCO_FLT_EXP, -std::numeric_limits<float>::digits10, std::numeric_limits<float>::digits10, 0, 0);
187 dc.ToFixed(value, precision, &builder);
188 builder.Finalize();
189}
190
191
192std::string& floatToStr(std::string& str, float value, int precision, int width, char thSep, char decSep)

Callers 3

appendMethod · 0.85
NumericString.cppFile · 0.85
formatMethod · 0.85

Calls 2

ToFixedMethod · 0.80
FinalizeMethod · 0.80

Tested by

no test coverage detected