Difference between revisions of "Documentation/How Tos/Calc: BASE function"

From Apache OpenOffice Wiki
Jump to: navigation, search
m (Robot: Automated text replacement %s)
m (Robot: Automated text replacement %s)
Line 25: Line 25:
 
{{Documentation/SeeAlso|
 
{{Documentation/SeeAlso|
 
* [[Documentation/How_Tos/Calc: DECIMAL function|DECIMAL]]
 
* [[Documentation/How_Tos/Calc: DECIMAL function|DECIMAL]]
* [[Documentation/How_Tos/Calc: FIXED function|FIXED]]'''
+
* [[Documentation/How_Tos/Calc: FIXED function|FIXED]]
  
 
* [[Documentation/How_Tos/Calc: BIN2DEC function|BIN2DEC]]
 
* [[Documentation/How_Tos/Calc: BIN2DEC function|BIN2DEC]]
 
* [[Documentation/How_Tos/Calc: BIN2HEX function|BIN2HEX]]
 
* [[Documentation/How_Tos/Calc: BIN2HEX function|BIN2HEX]]
* [[Documentation/How_Tos/Calc: BIN2OCT function|BIN2OCT]]'''
+
* [[Documentation/How_Tos/Calc: BIN2OCT function|BIN2OCT]]
  
* [[Documentation/How_Tos/Calc: ISTEXT function|ISTEXT]]'''
+
* [[Documentation/How_Tos/Calc: ISTEXT function|ISTEXT]]
  
* [[Documentation/How_Tos/Calc: Text functions|Text functions]]'''
+
* [[Documentation/How_Tos/Calc: Text functions|Text functions]]
  
 
* [[Documentation/How_Tos/Calc: Functions listed alphabetically|Functions listed alphabetically]]
 
* [[Documentation/How_Tos/Calc: Functions listed alphabetically|Functions listed alphabetically]]
 
* [[Documentation/How_Tos/Calc: Functions listed by category|Functions listed by category]]}}
 
* [[Documentation/How_Tos/Calc: Functions listed by category|Functions listed by category]]}}

Revision as of 13:54, 26 February 2009


BASE

Returns a text representation of a number, in a specified base radix.

Syntax:

BASE(number; radix; minlength)

converts number (a positive integer) to text, with the base radix radix (an integer between 2 and 36), using characters 0-9 and A-Z.
minlength (optional) specifies the minimum number of characters returned; zeroes are added on the left if necessary.

Example:

BASE(17; 2)

returns 10001 as text (binary system).

BASE(17; 10)

returns 17 as text (decimal system).

BASE(255; 16; 4)

returns 00FF as text (hexadecimal system). Extra zeroes are added to give 4 characters.

ISTEXT(BASE(17; 10))

returns TRUE. Text is returned, not a number.

Template:Documentation/SeeAlso

Personal tools