QuantityForm
✖
QuantityForm
更多信息

- 可以指定下列单位显示格式: "Abbreviation"、"LongForm".
- 可以以显示格式指定包括 "SingularForm" 来强制 "LongForm" 描述使用单数形式.
- 如果 expr 是一个标准单位,QuantityForm 将使用单位的特定格式显示在屏幕上.
- 当输入的运算结果为 QuantityForm[expr] 时,QuantityForm 不会出现在输出中. »
范例
打开所有单元关闭所有单元基本范例 (2)常见实例总结
范围 (5)标准用法实例范围调查
QuantityForm 作用于表达式中的所有 Quantity 对象:

https://wolfram.com/xid/0en2oesuy-blton0


https://wolfram.com/xid/0en2oesuy-n60abg

可能的显示格式为 "Abbreviation" 和 "LongForm":

https://wolfram.com/xid/0en2oesuy-ix1xaz


https://wolfram.com/xid/0en2oesuy-7vke1


https://wolfram.com/xid/0en2oesuy-ic9j9i

基于每个 Quantity 的值,"LongForm" 描述选择单数/复数形式:

https://wolfram.com/xid/0en2oesuy-kjd0c0


https://wolfram.com/xid/0en2oesuy-0clw69

"SingularForm" 可以与 "LongForm" 一起使用,以强制单位描述使用单数形式:

https://wolfram.com/xid/0en2oesuy-eplsej

如果第一个参数是标准单位,QuantityForm 会打印带有单位的指定格式:

https://wolfram.com/xid/0en2oesuy-0xgjk

QuantityForm 适用于 MixedUnit 规范:

https://wolfram.com/xid/0en2oesuy-kyi2q


https://wolfram.com/xid/0en2oesuy-blhj0v

属性和关系 (4)函数的属性及与其他函数的关联
对于没有缩略格式的单位,"Abbreviation" 等同于 "LongForm":

https://wolfram.com/xid/0en2oesuy-bwkqt


https://wolfram.com/xid/0en2oesuy-nwrrz0


https://wolfram.com/xid/0en2oesuy-kxorf

IndependentUnit 规范没有特定单位的显示格式:

https://wolfram.com/xid/0en2oesuy-nvp76


https://wolfram.com/xid/0en2oesuy-gu63mk


https://wolfram.com/xid/0en2oesuy-hejk0r

"Abbreviation" 和 "LongForm" 可以一起被指定:

https://wolfram.com/xid/0en2oesuy-b9cdc8

当输入的运算结果为 QuantityForm[expr] 时,QuantityForm 不会出现在输出中:

https://wolfram.com/xid/0en2oesuy-2ouuvt

赋给 Out 的值是 ,不是 QuantityForm[
,"LongForm"]:

https://wolfram.com/xid/0en2oesuy-6s8n4s

可能存在的问题 (2)常见隐患和异常行为
QuantityForm 的第一个参数应该是一个标准单位,或者包含 Quantity 的表达式:

https://wolfram.com/xid/0en2oesuy-ul5c8n


https://wolfram.com/xid/0en2oesuy-53c055

即便输出省略了上一层的 QuantityForm,子表达式中依然存在:

https://wolfram.com/xid/0en2oesuy-419t3x

输出中没有 QuantityForm:

https://wolfram.com/xid/0en2oesuy-ueqfwv

但是,变量 e 含有 QuantityForm,可能会影响后续的计算:

https://wolfram.com/xid/0en2oesuy-lrm1ym

由于 QuantityForm 的存在,不能计算 QuantityMagnitude:

https://wolfram.com/xid/0en2oesuy-wovh0o

先对变量赋值,然后对结果应用 QuantityForm,使计算可以进行:

https://wolfram.com/xid/0en2oesuy-q46l8z


https://wolfram.com/xid/0en2oesuy-r9rcnb

Wolfram Research (2012),QuantityForm,Wolfram 语言函数,https://reference.wolfram.com/language/ref/QuantityForm.html.
文本
Wolfram Research (2012),QuantityForm,Wolfram 语言函数,https://reference.wolfram.com/language/ref/QuantityForm.html.
Wolfram Research (2012),QuantityForm,Wolfram 语言函数,https://reference.wolfram.com/language/ref/QuantityForm.html.
CMS
Wolfram 语言. 2012. "QuantityForm." Wolfram 语言与系统参考资料中心. Wolfram Research. https://reference.wolfram.com/language/ref/QuantityForm.html.
Wolfram 语言. 2012. "QuantityForm." Wolfram 语言与系统参考资料中心. Wolfram Research. https://reference.wolfram.com/language/ref/QuantityForm.html.
APA
Wolfram 语言. (2012). QuantityForm. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/QuantityForm.html 年
Wolfram 语言. (2012). QuantityForm. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/QuantityForm.html 年
BibTeX
@misc{reference.wolfram_2025_quantityform, author="Wolfram Research", title="{QuantityForm}", year="2012", howpublished="\url{https://reference.wolfram.com/language/ref/QuantityForm.html}", note=[Accessed: 06-April-2025
]}
BibLaTeX
@online{reference.wolfram_2025_quantityform, organization={Wolfram Research}, title={QuantityForm}, year={2012}, url={https://reference.wolfram.com/language/ref/QuantityForm.html}, note=[Accessed: 06-April-2025
]}