Grote het script snippet Sticky
| Grote het script snippet Sticky |
 |
| Het snippets lijstje |
- Bytes to PB/TB/GB/MB/kB transform script.
Alle script snippets zijn vrij voor gebruik. |
Heb je nuttige snippets open en topic. Met [Snippet] in de titel.
En ja de code tags verneuken het design  |
"My software never has bugs, it just develops random features."

code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
| '--------------------------------------------------------------------------------------------
'-------------------------- Bytes function (c) Aapje.
'-------------------------- Creator: baboon@the-baboon.nl
'-------------------------- Last edited: 17-03-06
'--------------------------------------------------------------------------------------------
Function ByteFormat(strByte)
If strByte < 0 Then ByteFormat = "N/A"
If (strByte / 1000000000000000) >= 1 and ByteFormat = "" Then ByteFormat = "<code><b>" & Round(strByte / 1125899906842624, 2) & "PB</b></code>"
If (strByte / 1000000000000) >= 1 and ByteFormat = "" Then ByteFormat = "<code><b>" & Round(strByte / 1099511627776, 2) & "TB</b></code>"
If (strByte / 1000000000) >= 1 and ByteFormat = "" Then ByteFormat = "<code><b>" & Round(strByte / 1073741824, 2) & "GB</b></code>"
If (strByte / 1000000) >= 1 and ByteFormat = "" Then ByteFormat = "<code>" & Round(strByte / 1048576, 2) & "MB</code>"
If (strByte / 1000) >= 1 and ByteFormat = "" Then ByteFormat = "<code>" & Round(strByte / 1024, 2) & "kB</code>"
If ByteFormat = "" Then ByteFormat = "<code>" & Round(strByte) & "B</code>"
End Function |
"My software never has bugs, it just develops random features."
Dit onderwerp heeft 1 reactie, en bestaat uit 1 pagina.
De laatste reactie is geplaatst op 17-03-2006 22:03.