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

Examples

open allclose all

Basic Examples  (2)

Show a decimal number as a percentage:

Display a table of random percentages:

Scope  (3)

Numbers of any size and sign can be shown in percent form:

PercentForm works on integers:

PercentForm does not work on rational or complex numbers:

Display percentages with different precisions:

Options  (8)

DefaultPrintPrecision  (1)

By default, percentages are shown with precision 4:

Show percentages with default precision 6:

DigitBlock  (1)

Default representation:

Digits separated in blocks of length 3:

NumberPadding  (2)

The default does not pad on the left or right:

Pad with spaces on the left:

Pad with spaces on the left to align percentages in a table:

NumberPoint  (1)

By default, the decimal point is printed if decimal digits would be printed after it:

Use a decimal point even when no digits follow:

Display with a comma (,) instead:

NumberSeparator  (1)

The default separator is a comma (,):

Use spaces instead:

SignPadding  (2)

The default pads before signs:

Pad between signs and numbers instead:

PercentForm by default pads before the - and % signs:

Pad inside the signs:

Pad after the signs:

Pad outside the signs:

Properties & Relations  (2)

PercentForm never uses scientific form:

Quantity can be used to work with percentages:

Convert to a normal number:

Represent that number using PercentForm:

They are the same number:

Possible Issues  (1)

Placeholder zeros may be needed if the requested precision is small:

Introduced in 2019
 (12.0)