QuantityForm[expr,form]
指定された単位表示形式 form を使って expr をすべてのQuantity式とともに出力する.
QuantityForm[expr,{forms}]
指定された単位の表示形式 forms の適切な組合せを使って expr を出力する.
QuantityForm
QuantityForm[expr,form]
指定された単位表示形式 form を使って expr をすべてのQuantity式とともに出力する.
QuantityForm[expr,{forms}]
指定された単位の表示形式 forms の適切な組合せを使って expr を出力する.
詳細
- 指定できる単位表示形式には "Abbreviation"と"LongForm"がある.
- "SingularForm"は,"LongForm"表現を強制的に単数形にするための表示形式指定として含むことができる.
- expr が標準単位の場合,QuantityFormは指定された形の単位とともに出力される.
- QuantityFormは,入力を評価するとQuantityForm[expr]になるときは出力には現れない. »
例題
すべて開く すべて閉じる例 (2)
QuantityForm[Quantity[3, "Meters" / "Seconds"], "LongForm"]QuantityForm[Quantity[.75, "Feet"], {"Abbreviation", "LongForm"}]QuantityForm[Quantity[.75, "Feet"], {"Abbreviation", "LongForm", "SingularForm"}]QuantityForm[Quantity[1.2, "Farads"], {"Abbreviation", "LongForm"}]スコープ (5)
QuantityFormは,式中のすべてのQuantityオブジェクトに働く:
QuantityForm[{Quantity[4, "Joules"], Quantity[9, "Sieverts"], Quantity[3, "Ohms"]}, {"Abbreviation", "LongForm"}]QuantityForm[<|"Distance" -> Quantity[260, "Miles"], "Duration" -> Quantity[3, "Hours"]|>, "LongForm"]可能な表示形式は"Abbreviation"および"LongForm"である:
expr = Quantity[5, "Grams" / "Meters" ^ 3]QuantityForm[expr, "Abbreviation"]QuantityForm[expr, "LongForm"]"LongForm"表現は,各Quantityの値に基づいて単数/複数の違いを選択する:
QuantityForm[Quantity[1, "Seconds"], {"LongForm"}]QuantityForm[Quantity[.7, "Seconds"], {"LongForm"}]"SingularForm"を"LongForm"とともに使って単位表現を強制的に単数形にすることができる:
QuantityForm[Quantity[.7, "Seconds"], {"LongForm", "SingularForm"}]第1引数が標準単位のとき,QuantityFormは単位を指定形式で出力する:
QuantityForm["Feet", {"Abbreviation", "LongForm"}]QuantityFormはMixedUnit指定で使うことができる:
Quantity[MixedMagnitude[{1, 2}], MixedUnit[{"Feet", "Inches"}]]QuantityForm[%, {"Abbreviation", "LongForm"}]アプリケーション (1)
特性と関係 (4)
短縮形がない単位については,"Abbreviation"と"LongForm"は等価である:
q = Quantity["UniverseMass"]QuantityForm[q, "LongForm"]QuantityForm[q, "Abbreviation"]IndependentUnit指定には特殊単位の表示形がない:
q = Quantity[2, IndependentUnit["Unit"]]QuantityForm[q, "LongForm"]QuantityForm[q, "Abbreviation"]"Abbreviation"と"LongForm"は一緒に指定することができる:
QuantityForm[Quantity[4.7, "Meters" ^ 2], {"LongForm", "Abbreviation"}]QuantityFormは,入力を評価するとQuantityForm[expr,form]になるときは出力には現れない:
QuantityForm[Quantity[1, "Meters"], "LongForm"]OutにはQuantityForm[
,"LongForm"]ではなく値
が割り当てられる:
%考えられる問題 (2)
QuantityFormの第1引数は標準単位あるいはQuantityを含む式でなければならない:
QuantityForm[{3, "Feet", Quantity[3, "Feet"]}, {"Abbreviation", "LongForm"}]QuantityForm["Feet", {"Abbreviation", "LongForm"}]QuantityFormは,出力のトップレベルから省略された場合でも部分式からは削除されない:
e = QuantityForm[Quantity[1, "Meters"], "LongForm"]出力はQuantityFormではない:
%しかし,変数 e はQuantityFormなので,続く評価に影響するかもしれない:
FullForm[e]QuantityFormが介在するためQuantityMagnitudeは評価されない:
QuantityMagnitude[e]まず変数に割当てを行い.次に結果にQuantityFormを適用することで計算可能性を維持する:
QuantityForm[f = Quantity[1, "Meters"], "LongForm"]QuantityMagnitude[f]テクニカルノート
-
▪
- 単位の概要
テキスト
Wolfram Research (2012), QuantityForm, Wolfram言語関数, https://reference.wolfram.com/language/ref/QuantityForm.html.
CMS
Wolfram Language. 2012. "QuantityForm." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/QuantityForm.html.
APA
Wolfram Language. (2012). QuantityForm. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/QuantityForm.html
BibTeX
@misc{reference.wolfram_2026_quantityform, author="Wolfram Research", title="{QuantityForm}", year="2012", howpublished="\url{https://reference.wolfram.com/language/ref/QuantityForm.html}", note=[Accessed: 02-November-2026]}
BibLaTeX
@online{reference.wolfram_2026_quantityform, organization={Wolfram Research}, title={QuantityForm}, year={2012}, url={https://reference.wolfram.com/language/ref/QuantityForm.html}, note=[Accessed: 02-November-2026]}