# 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

# 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:

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 (,):

PercentForm by default pads before the - and % 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)