Konversikan bilangan ke basis lain.
=BASE(number, radix, [min_length])
| Parameter | Deskripsi |
|---|---|
number |
The number to convert to a given base. |
radix |
The base to convert to. |
min_length |
[optional] The minimum string length to return, achieved by padding with zeros. |
The radix argument specifies base and the output from the BASE function is a text string. For example, the formulas below convert the number 13 into t
=BASE(13,2) // returns "1101"
=BASE(13,10) // returns "13"
=BASE(13,16) // returns "D"
In the worksheet shown, the input numbers are being converted to three different representations: base 2 (binary), base 10 (decimal), and base 16 (hex
=BASE(B5,2) // base 2
=BASE(B5,10) // base 10
=BASE(B5,16) // base 16
The function also offers an optional argument min_length which will pad the returned string with zeros when its length is less than the given value. F
=BASE(3,2,4) // returns "0011" as text
=BASE(10,16,4) // returns "000A" as text
The DECIMAL function performs the opposite conversion as the BASE function:
=BASE(100,2) // returns "1100100"
=DECIMAL("1100100",2) // returns 100