When im using printf,
printf("%.2f zł", 20.4);
it returns
20.40 zł9
but i want
20.40 zł
When i use sprintf("%.2f zł", 20.4) there is no problem.
zł is polish currency symbol. When i replace “ł” with “l” i still have problem like this, so it looks like this is not related with encoding.
How can I use printf for currency correctly?
I got it.
I wrote:
instead of just:
After string produced by printf() i got that string length, which is value returned by printf (in fact – added number was 9 in case of 123.45 value, in 20.4 case it was number 8).