$base » History » Version 5
Per Amundsen, 08/09/2015 06:04 AM
1 | 1 | Per Amundsen | _Added in 1.9.0_ |
---|---|---|---|
2 | |||
3 | *$base(N,inbase,outbase,zeropad,precision)* |
||
4 | |||
5 | Converts number N from inbase to outbase. The last two parameters are optional. |
||
6 | |||
7 | *Parameters* |
||
8 | |||
9 | N - The number to convert. |
||
10 | inbase - The base to convert from. |
||
11 | outbase - The base to convert to. |
||
12 | 4 | Per Amundsen | zeropad - If length is higher than zeropad, pad numbers with zeroes to this zeropad length. |
13 | 1 | Per Amundsen | precision - TODO |
14 | |||
15 | *Example* |
||
16 | |||
17 | <pre> |
||
18 | 5 | Per Amundsen | ; Returns F |
19 | 1 | Per Amundsen | //echo -ag $base(15,10,16) |
20 | |||
21 | 5 | Per Amundsen | ; Returns 1.8 |
22 | 1 | Per Amundsen | //echo -ag base(1.5,10,16) |
23 | |||
24 | 5 | Per Amundsen | ; Returns 002 |
25 | 1 | Per Amundsen | //echo -ag $base(2,10,16,3) |
26 | </pre> |