![]() |
|
#1
|
||||
|
||||
[function] Converting BytesPHP Code:
EXAMPLE CODE PHP Code:
__________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
||||
|
#2
|
|||
|
|||
Re: [function] Converting Bytesum... the math is incorrect. this really should be :
Code:
|
|
#3
|
||||
|
||||
Re: [function] Converting BytesThank you for your feedback. However, there is nothing wrong with the 'math'.
You didn't notice that the last three 'case's are without breaks. Because you missed that little detail, your suggestion does not work. It would, if you had placed the break between the cases. |
|
#4
|
|||
|
|||
Re: [function] Converting BytesHum... I see...
My fault because i had actually copied your code.. I thought letter for letter on a different screen while looking at your code example.. You are right i did miss the LACK of the breaks. Are there any advantages of doing this either way ? |
|
#5
|
||||
|
||||
Re: [function] Converting BytesI've been dabbling in PHP long enough to admit that there is always a better way to write code. Especially something I wrote 3 years ago... :P
Your idea is good and I see nothing wrong with it (except for the missing breaks), so we'll leave it here with our comments so far. The reader can decide for herself how she would use the information here. |
Recent GIDBlog
Master?s Degree by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [function] Show limited words of a string / text | JdS | PHP Code Library | 0 | 05-Jun-2003 09:25 |
| [Function] Int to Money Conversion | Elmseeker | PHP Code Library | 1 | 30-Jan-2003 23:10 |
| [function] BBCodes Collection | JdS | PHP Code Library | 1 | 26-Jan-2003 09:48 |
| [function] Validate Email Addresses I | JdS | PHP Code Library | 0 | 23-Jan-2003 03:21 |
| [function] Timer | JdS | PHP Code Library | 0 | 18-Jan-2003 18:11 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The