When I write a simple wprintf
function and pass a double to it a float
number using the verb notation L"%.2f"
it simply prints an "f
" on the screen instead of a number like in the format 0.00
.
I would like some help as everywhere I look it simply says L"%.2f"
is the way to print a number with 2 decimal digit precision.
float duration = (float)((std::clock() - mTimer) / (float)(CLOCKS_PER_SEC / 1000));
wsprintf(message, L">> Speed: %.2f\r\n", duration);
These are the 2 lines causing my headache... they result in
>> Speed: f
being printed on the console.
The output i'm looking for is this:
>> Speed: 4000.00