MCPcopy Create free account
hub / github.com/Tencent/libpag / FormatFloat

Function FormatFloat

exporter/src/utils/ConfigUtils.cpp:47–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45}
46
47std::string FormatFloat(float value, int precision) {
48 std::ostringstream oss;
49 if (precision == 0 && value == static_cast<int>(value)) {
50 oss << static_cast<int>(value);
51 } else {
52 oss << std::fixed << std::setprecision(precision) << value;
53 }
54 return oss.str();
55}
56
57void AddElement(tinyxml2::XMLElement* parent, const std::string& name, const std::string& value) {
58 tinyxml2::XMLDocument* doc = parent->GetDocument();

Callers 2

WriteCommonConfigFunction · 0.85
WriteBitmapConfigFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected