WOLFRAM
Products
Wolfram|One
Mathematica
Wolfram Notebook Assistant + LLM Kit
Wolfram|Alpha Notebook Edition
System Modeler
All Products
Consulting & Solutions
Wolfram Consulting
Industry Solutions
Solutions for Education
Learning & Support
Wolfram U Courses
Wolfram Language Resources
Wolfram Community
Support FAQs
Contact Support
Company
About Wolfram
Careers
Events
Educational Programs
All Sites and Resources
Wolfram|Alpha
Wolfram Cloud
Your Account
Your Account
User Portal
Search
Legacy Documentation
Mathematica 6
(2007)
This is documentation for Mathematica 6, which was
based on an earlier version of Wolfram Language.
View current documentation (Version 14.3)
Mathematica
>
Number Digits
>
Built-in
Mathematica
Symbol
IntegerDigits
IntegerLength
RealDigits
BaseForm
NumberForm
FromDigits
See Also »
|
Converting between Expressions & Strings
Number Digits
New in 6.0: Core Language
New in 6.0: Mathematics & Algorithms
New in 6.0: Number Theory & Integer Functions
More About »
IntegerString
IntegerString
[
n
]
gives a string consisting of the decimal digits in the integer
n
.
IntegerString
[
n
,
b
]
gives a string consisting of the base
digits in the integer
n
.
IntegerString
[
n
,
b
,
len
]
pads the string on the left with zero digits to give a string of length
len
.
IntegerString
[
n
, "Roman"]
gives the Roman numeral form of
n
.
MORE INFORMATION
The maximum allowed base is 36. For bases larger than 10, additional digits are chosen from the letters
a
-
z
.
If
len
is less than the number of digits in
n
then the
len
least significant digits are returned.
FromDigits
can be used as the inverse of
IntegerString
.
EXAMPLES
CLOSE ALL
Basic Examples
(2)
Convert to binary, giving the result as a string:
In[1]:=
Out[1]//InputForm=
Convert to Roman numerals:
In[1]:=
Out[1]=
Scope
(1)
Generalizations & Extensions
(1)
Properties & Relations
(1)
Neat Examples
(1)
SEE ALSO
IntegerDigits
IntegerLength
RealDigits
BaseForm
NumberForm
FromDigits
MORE ABOUT
Converting between Expressions & Strings
Number Digits
New in 6.0: Core Language
New in 6.0: Mathematics & Algorithms
New in 6.0: Number Theory & Integer Functions
New in 6