1. QString stry;
double y;
y = 6.44;
stry = QString::number(y,'f',1);
//stry = stry.number(y,'f',1);
2. 其中’f’表示以什么样的格式输出:
Format Meaning
e format as [-]9.9e[+|-]999
E format as [-]9.9E[+|-]999
f format as [-]9.9
g use e or f format, whichever is the most concise
G use E or f format, whichever is the most concise
3. 小数点后保留几位?
1表示保留一位。