本人的嵌入式职业英文记录 - 第1周
来源:互联网 发布:国家质检总局网络培训 编辑:程序博客网 时间:2024/06/04 19:34
时间:2016/10/31 - 2016/11/06
单词来源学习(出处):
属于:Qt中的类QString的方法number格式举例讲解:
例句:
QString QString::number ( double n, char format = 'g', int precision = 6 ) [static]
Returns a string equivalent(1) of the number n, formatted according to the specified format and precision. See Argument Formats for details.
Argument Formats
翻译:返回一个字符串的数字n,格式化按照指定的格式和精度。有关详细信息,请参阅参数格式。
参数格式
In member functions where an argument format can be specified (e.g., arg(), number()), the argument format can be one of the following:
解释:在成员函数可以指定一个参数格式(如。arg(),()),参数的格式可以是下列之一:
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
解释:用G,E,f格式,无论是哪一个,都是最简洁的;
A precision(2) is also specified(3) with the argument format. For the 'e', 'E', and 'f' formats, the precision represents the number of digits(4) after the decimal point. For the 'g' and 'G' formats, the precision represents the maximum number of significant digits (trailing(5) zeroes are omitted(6)).
解释:精度也是指定的参数格式。对于“e”、“E”和“f”格式,精度表示小数点后的位数。‘g’和‘G’格式、精度表示有效数字的最大数量(落后于0是省略了)。
单词收集:1.equivalent
英 [ɪ'kwɪv(ə)l(ə)nt] 美 [ɪ'kwɪvələnt]
n. 等价物,相等物
2.precision:
英 [prɪ'sɪʒ(ə)n] 美 [prɪ'sɪʒn]
n. 精度,[数] 精密度;精确
adj. 精密的,精确的
3.specified:原型为specify
英 ['spesɪfaɪ] 美 ['spɛsɪfaɪ]
vt. 指定;详细说明;列举;把…列入说明书
4.digit:
英 ['dɪdʒɪt] 美 ['dɪdʒɪt]
n. 数字;手指或足趾;一指宽
5.trailing:原型为trail
英 [treɪl] 美 [trel]
vt. 追踪;拖;蔓延;落后于
n. 小径;痕迹;尾部;踪迹;一串,一系列
vi. 飘出;蔓生;垂下;拖曳
n. (Trail)人名;(英)特雷尔
6.omitted:原型为omit
英 [ə(ʊ)'mɪt] 美 [ə'mɪt]
vt. 省略;遗漏;删除;疏忽
知识点收集:
这里的number方法的格式为:
QString QString::number ( double n, char format = 'g', int precision = 6 ) [static]
第一个参数为提取的数字,第二个参数为输出的格式,第三个参数为提取的数小数点后保留的位数;
例子:
int data;
ui->lbl_time_hour->setText(QString::number(data,'f',0));
作用:设置ui界面的lbl_time_hour控件为data,设置精确度为‘f’,设置输出的值小数点后面没有数,为整数;
- 本人的嵌入式职业英文记录 - 第1周
- 本人的嵌入式职业英文记录 - 第2周
- 本人的嵌入式职业英文记录 - 第3周
- 本人的嵌入式职业英文记录 - 第4周
- 本人的嵌入式职业英文记录 - 第5周
- 本人的嵌入式职业英文记录 - 开篇
- 本人的嵌入式职业英文记录
- 闲聊嵌入式职业发展(1)
- 本人的第一篇博客
- 本人大菜,这是发的第一篇blog,记录下自己的学习生活
- 职业经理人必备的英文词汇
- 本人在嵌入式在线的博客
- 记录,某公司的职业要求
- 嵌入式开发的职业前景分析
- 嵌入式开发的职业前景分析
- 嵌入式领域的职业发展方向是什么?
- 关于嵌入式的学习和职业发展
- 关于嵌入式的学习和职业发展
- FlycoTabLayout使用
- 查找中位数(java 快速排序)
- 微信登录学习笔记
- Java 反射机制
- LightOJ 1029 【最小生成树】
- 本人的嵌入式职业英文记录 - 第1周
- Linux设备口
- 从接口与抽象类说起
- php迭代器模式
- 在Python2.7里安装SOAPpy和问题解决
- Android ListView之高亮显示
- input元素添加监听事件
- iOS高级编程之安全机制,为你的App保驾护航
- jQuery对象与DOM对象之间的转换方法