Binary digits: Difference between revisions
Content added Content deleted
No edit summary |
No edit summary |
||
Line 3,043: | Line 3,043: | ||
1- Function DecToBin(ByVal Number As Long) As String |
1- Function DecToBin(ByVal Number As Long) As String |
||
'''Arguments :''' |
'''Arguments :''' |
||
[Required] Number (Long) : ''should be a positive number'' |
[Required] Number (Long) : ''should be a positive number'' |
||
2- Function DecToBin2(ByVal Number As Long, Optional Places As Long) As String |
2- Function DecToBin2(ByVal Number As Long, Optional Places As Long) As String |
||
'''Arguments :''' |
'''Arguments :''' |
||
[Required] Number (Long) : ''should be >= -512 And <= 511'' |
[Required] Number (Long) : ''should be >= -512 And <= 511'' |
||
[Optional] Places (Long) : ''the number of characters to use.'' |
[Optional] Places (Long) : ''the number of characters to use.'' |
||
Note : If places is omitted, DecToBin2 uses the minimum number of characters necessary. |
Note : If places is omitted, DecToBin2 uses the minimum number of characters necessary. |
||
Places is useful for padding the return value with leading 0s (zeros). |
Places is useful for padding the return value with leading 0s (zeros). |