Is It possible to show zeros numbers after decimal point in a QLabel?
Hello, this is my first question in this forum, sorry if I make a mistake.
Im using a QLabel to show float numbers, that is working, my problem is that I want to show ever two numbers after the decimal point. eg If the number is 1.55 shows 1.55, but whe the numer is 1.50 shows 1.5 and I want to show 1.50 or if the number is 1.00 shows 1 and I want to show 1.00.
I am using setNum(number) to show the value.
Any suggestion? anywone can help me?
Thanks
Re: Is It possible to show zeros numbers after decimal point in a QLabel?
Doesn't QString::number with the 'g' format specifier do what you want?
Edit: Sorry, misread your post, you want the format specifier 'f' with precision of 2.
Re: Is It possible to show zeros numbers after decimal point in a QLabel?
Re: Is It possible to show zeros numbers after decimal point in a QLabel?
Quote:
Originally Posted by
jimbo
Yes i coul resolve it, thanks for you reply
Thank you, i could resolve it