File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,17 @@ std::string itoa(T t) {
3333#endif
3434}
3535
36+ template <class T >
37+ std::string ftoa (T t) {
38+ #ifdef _WINDOWS
39+ return std::to_string (static_cast <long double >(t));
40+ #else
41+ std::stringstream s;
42+ s << t;
43+ return s.str ();
44+ #endif
45+ }
46+
3647}
3748}
3849
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ class JSONStat {
3535public:
3636 JSONStat (const char * name) { this ->name = name; value = NULL ; }
3737 void setValue (char * value) { this ->value = value;}
38- void setValue (double value) { this ->value = ibmras::common::itoa (value); };
38+ void setValue (double value) { this ->value = ibmras::common::ftoa (value); };
3939 const char * getName ();
4040 char * getValue ();
4141private:
You can’t perform that action at this time.
0 commit comments