Jan 21, 2003 #1 ChrisRChamberlain Programmer Joined Mar 23, 2000 Messages 3,392 Location GB Do you ever need to express the size of a file in KB as opposed to bytes? If so, see faq184-3055 FAQ184-2483 - the answer to getting answered.Chris
Do you ever need to express the size of a file in KB as opposed to bytes? If so, see faq184-3055 FAQ184-2483 - the answer to getting answered.Chris
Jan 21, 2003 #2 GriffMG Programmer Joined Mar 4, 2002 Messages 6,345 Location FR Chris, I'm guessing the if... else segment is intended to differentiate between KB & MB, so the code could read: Code: FUNCTION Bytes2KB LPARAMETERS nValue lnKB = (nValue/1.024) / 1000 IF lnKB > 999.99 RETURN TRANSFORM(CEILING(lnKB/1.024/1000),[999,999])+[MB] ELSE RETURN TRANSFORM(CEILING(nValue/1.024/1000),[999,999])+[KB] ENDI Regards Griff Keep [Smile]ing
Chris, I'm guessing the if... else segment is intended to differentiate between KB & MB, so the code could read: Code: FUNCTION Bytes2KB LPARAMETERS nValue lnKB = (nValue/1.024) / 1000 IF lnKB > 999.99 RETURN TRANSFORM(CEILING(lnKB/1.024/1000),[999,999])+[MB] ELSE RETURN TRANSFORM(CEILING(nValue/1.024/1000),[999,999])+[KB] ENDI Regards Griff Keep [Smile]ing
Jan 21, 2003 Thread starter #3 ChrisRChamberlain Programmer Joined Mar 23, 2000 Messages 3,392 Location GB Griff Thanks for spotting the typo! It will be corrected. FAQ184-2483 - the answer to getting answered.Chris
Griff Thanks for spotting the typo! It will be corrected. FAQ184-2483 - the answer to getting answered.Chris