hii..
I want to display number on the label;
I can do this by following code :
my problem is if the number is single digit i.e 2 i want to display it as 02 in label.
how can this be done?
Printable View
maybe you can aslo try QRegExp to check if it has only one digit and if yes then prepend 0
the first
you exmaple works after modification under Qt 4.5.0
the second it adds zero only for positive values. ;)
Quote:
"-20"
"-19"
"-18"
"-17"
"-16"
"-15"
"-14"
"-13"
"-12"
"-11"
"-10"
"-9"
"-8"
"-7"
"-6"
"-5"
"-4"
"-3"
"-2"
"-1"
"00"
"01"
"02"
"03"
"04"
"05"
"06"
"07"
"08"
"09"
"10"
"11"
"12"
"13"
"14"
"15"
"16"
"17"
"18"
"19"
"20"