MCPcopy Create free account
hub / github.com/NatLabRockies/OpenStudio / formatString

Function formatString

src/radiance/ForwardTranslator.cpp:102–127  ·  view source on GitHub ↗

internal method used to format doubles as strings

Source from the content-addressed store, hash-verified

100
101 // internal method used to format doubles as strings
102 std::string formatString(double t_d, unsigned t_prec) {
103 std::stringstream ss;
104 ss << std::setprecision(t_prec) << std::noshowpoint << std::fixed << t_d;
105 std::string s = ss.str();
106
107 /*
108 // truncate 0's from the end
109 int i = s.size() - 1;
110 while (i > 0 && s[i] == '0')
111 {
112 --i;
113 }
114
115 if (i > 0)
116 {
117 s.erase(i + 1);
118
119 if (*s.rbegin() == '.')
120 {
121 s.push_back('0');
122 }
123 }
124 */
125
126 return s;
127 }
128
129 // internal method used to format all other types as strings
130 template <typename T>

Callers 8

windowGroupPointsMethod · 0.85
translateModelMethod · 0.85
buildingSpacesMethod · 0.85
TESTFunction · 0.85
addComponentMethod · 0.85
addMeasureMethod · 0.85

Calls 1

strMethod · 0.45

Tested by 1

TESTFunction · 0.68