Try:
CString str;
str.Format(_T("%.2f"), 46.71438243077313);
Quote:
it doesn't work
Quote:
the result is 0.00
And how - exactly - did you check that? What code did you use? Because when I try it:
#include <iostream>
#include <atlstr.h>
int main()
{
std::cout << "Hello, world!\n";
CString str;
str.Format(_T("%.2f"), 46.71438243077313);
std::cout<< str;
}
I get this:
Quote:
/LIBPATH:C:\boost_1_60_0\stage\lib
Microsoft (R) C/C++ Optimizing Compiler Version 19.00.23506 for x64
Hello, world!
46.71
Which is what I expect...