PercentForm[expr]
prints with numbers in expr given as percentages.
PercentForm[expr,n]
prints with approximate real numbers in expr given as percentages to n-digit precision.
PercentForm
PercentForm[expr]
prints with numbers in expr given as percentages.
PercentForm[expr,n]
prints with approximate real numbers in expr given as percentages to n-digit precision.
Details and Options
- PercentForm[x,{n,f}] displays with approximate real numbers having n digits, with f digits to the right of the decimal point.
- PercentForm works on integers as well as approximate real numbers.
- The following options can be given:
-
DefaultPrintPrecision 4 default print digits for machine numbers DigitBlock Infinity number of digits between breaks NumberPadding {"",""} strings to use for left and right padding NumberPoint Automatic decimal point string NumberSeparator {",", " "} string to insert at breaks between blocks SignPadding {False,True} whether to pad inside the number sign and percent sign - The typeset form of PercentForm[expr] is interpreted the same as expr when used in input. »
- When an input evaluates to PercentForm[expr], PercentForm does not appear in the output. »
Examples
open all close allBasic Examples (2)
Scope (3)
Numbers of any size and sign can be shown in percent form:
PercentForm[1234.56]PercentForm[-1234567890.]PercentForm[1.234 10 ^ -8]PercentForm works on integers:
Range[5]//PercentFormPercentForm does not work on rational or complex numbers:
PercentForm[2 / 3]PercentForm[1 + 2.I]Display percentages with different precisions:
x = 0.123456789PercentForm[x, 4]PercentForm[x, 7]Options (8)
DefaultPrintPrecision (1)
DigitBlock (1)
NumberPadding (2)
The default does not pad on the left or right:
PercentForm[{-0.6705, 0.6888, 0.41999}, 3]PercentForm[{-0.6705, 0.6888, 0.41999}, 4, NumberPadding -> {" ", ""}]Pad with spaces on the left to align percentages in a table:
PercentForm[RandomReal[1, {4, 3}]//TableForm, {4, 2}, NumberPadding -> {" ", "0"}]NumberPoint (1)
By default, the decimal point is printed if decimal digits would be printed after it:
PercentForm[0.54137]PercentForm[0.54]Use a decimal point even when no digits follow:
PercentForm[0.54, NumberPoint -> "."]Display with a comma (,) instead:
PercentForm[0.54137, NumberPoint -> ","]NumberSeparator (1)
SignPadding (2)
The default pads before signs:
PercentForm[{-0.1234, 0.24680}, 10, NumberPadding -> {" ", " "}]Pad between signs and numbers instead:
PercentForm[{-0.12345, 0.24680}, 10, SignPadding -> True, NumberPadding -> {" ", " "}]PercentForm by default pads before the - and % signs:
PercentForm[-0.001234``6, {8, 5}, NumberPadding -> {" ", "*"}]PercentForm[-0.001234``6, {8, 5}, NumberPadding -> {" ", "*"}, SignPadding -> {True, True}]PercentForm[-0.001234``6, {8, 5}, NumberPadding -> {" ", "*"}, SignPadding -> {True, False}]PercentForm[-0.001234``6, {8, 5}, NumberPadding -> {" ", "*"}, SignPadding -> {False, False}]Properties & Relations (4)
PercentForm never uses scientific form:
numbers = 1.234567{10 ^ 10, 1, 10 ^ -10}PercentForm[numbers]Quantity can be used to work with percentages:
q = Quantity[123.4, "Percent"]Normal[q]Represent that number using PercentForm:
PercentForm[%]q == %The typeset form of PercentForm[expr] is interpreted the same as expr when used in input:
{PercentForm[0.5]}Copy the output and paste it into an input cell. The 50% is interpreted as 0.5:
{0.5}When an input evaluates to PercentForm[expr], PercentForm does not appear in the output:
PercentForm[0.5]Out is assigned the value 0.5, not PercentForm[0.5]:
%Possible Issues (2)
Placeholder zeros may be needed if the requested precision is small:
PercentForm[12.345, 2]Even when an output omits PercentForm from the top level, it is not stripped from subexpressions:
e = PercentForm[0.05]The output does not have PercentForm in it:
%However, the variable e does have PercentForm in it, which may affect subsequent evaluations:
FullForm[e]The product is not evaluated due to the intervening PercentForm:
10 * eAssign variables first and then apply PercentForm to the result to maintain computability:
(f = 0.05)//PercentForm10 * fSee Also
Related Guides
History
Text
Wolfram Research (2019), PercentForm, Wolfram Language function, https://reference.wolfram.com/language/ref/PercentForm.html.
CMS
Wolfram Language. 2019. "PercentForm." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/PercentForm.html.
APA
Wolfram Language. (2019). PercentForm. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/PercentForm.html
BibTeX
@misc{reference.wolfram_2026_percentform, author="Wolfram Research", title="{PercentForm}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/PercentForm.html}", note=[Accessed: 15-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_percentform, organization={Wolfram Research}, title={PercentForm}, year={2019}, url={https://reference.wolfram.com/language/ref/PercentForm.html}, note=[Accessed: 15-June-2026]}