Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Mathematics and Algorithms > Numerical Evaluation & Precision > Display of Numbers > NumberForm >

NumberForm

NumberForm
prints with approximate real numbers in expr given to n-digit precision.
  • NumberForm prints with approximate real numbers having n digits, with f digits to the right of the decimal point.
  • NumberForm works on integers as well as approximate real numbers.
  • The following options can be given:
DigitBlockInfinitynumber of digits between breaks
ExponentFunctionAutomaticfunction to apply to exponents
ExponentStep1steps by which exponents can increase
NumberFormatAutomaticfunction used to assemble the mantissa, base, and exponent
NumberMultiplier"×"string to use to indicate multiplication
NumberPadding{"","0"}strings to use for left and right padding
NumberPoint"."decimal point string
NumberSeparator{",", " "}string to insert at breaks between blocks
NumberSigns{"-",""}strings to use for signs of negative and positive numbers
SignPaddingFalsewhether to insert padding after the sign
  • NumberForm acts as a "wrapper", which affects printing, but not evaluation.
Display the first 10 digits of a numeric approximation to :
Display a number with 3 precise digits and 4 digits to the right of the decimal:
Display the first 10 digits of a numeric approximation to :
In[1]:=
Click for copyable input
Out[1]//NumberForm=
 
Display a number with 3 precise digits and 4 digits to the right of the decimal:
In[1]:=
Click for copyable input
Out[1]//NumberForm=
The default display for a machine number:
Display more digits than the default:
Display fewer digits:
Format a complex number:
Format a high-precision number:
Change the display of numbers in a vector:
A matrix:
Change the display of inexact numbers in a mixed expression:
A default integer:
Digits separated in blocks of length 3:
Use five-digit blocks with spaces as separators:
Compute approximate powers of :
Restrict exponents to multiples of 3:
Include exponents only for powers greater than 10:
Default formatting to 10 digits:
Restrict exponent to multiples of 6:
Display numbers in a Fortran-like form:
Display only the mantissas:
Display the exponents after converting to scientific form:
Use the default multiplier :
Use an asterisk (*) instead:
The default does not pad on the left or right:
Pad with spaces on the left:
Pad with 0s on the right:
The default is a period:
Display with a comma (,) instead:
The default separator is a comma (,):
Use spaces instead:
The default includes negative signs but not positive signs:
Include positive signs as well:
Use words instead of symbols:
The default pads before signs:
Pad between signs and numbers instead:
Display numeric approximations of with increasing precision and number of decimal digits:
Display in a tabular form:
NumberForm and PaddedForm use the same mantissas and exponents by default:
ScientificForm has a single digit to the left of the decimal:
EngineeringForm uses exponents that are multiples of 3:
AccountingForm does not have exponents:
Convert a number to base 2:
Represent the number precise to 3 decimal digits in base 2:
Reconstruct the base 10 number precise to 3 digits:
Affect the display of numbers in MatrixForm or TableForm:
Placeholder zeros may be needed if the requested precision is small:
New in 1 | Last modified in 3
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team
Format:   HTML  |  CDF