<% ' Last Updated 19 May 2006 ' Jonathan Maxwell Function ChangeToCurrency(curMoneyValue) ' FORMATS MONEY VALUE AND GETS RID OF £,$ ETC. if isnull(curMoneyValue) = false then curMoneyValue = FormatCurrency(curMoneyValue,2) 'curMoneyValue = replace(curMoneyValue,",","") 'curMoneyValue = replace(curMoneyValue,")","") 'curMoneyValue = Mid(curMoneyValue, 2, len(curMoneyValue)) curMoneyValue = replace(curMoneyValue,"£","") curMoneyValue = replace(curMoneyValue,"$","") end if ChangeToCurrency = curMoneyValue End Function Function RoundUpDownNumber(dbNumber, strUpDown) ' Rounds a double up or down to an integer dim intTemp, intDecimalPointLocation intTemp = CStr(dbNumber) intDecimalPointLocation = (instr(intTemp, ".")-1) if intDecimalPointLocation > 0 then intTemp = mid(intTemp, 1, intDecimalPointLocation) if LCASE(strUpDown) = "up" then intTemp = CInt(intTemp) + 1 else intTemp = CInt(intTemp) end if RoundUpDownNumber = intTemp End Function Public Function BytesToKilobytes(Bytes) 'This function gives an estimate to two decimal 'places. For a more precise answer, format to 'more decimal places or just return dblAns Dim dblAns dblAns = (Bytes / 1024) BytesToKilobytes = Formatnumber(dblAns,2) End Function Public Function KilobytesToBytes(Kilobytes) Dim dblAns dblAns = (1024*Kilobytes) KilobytesToBytes = CLng(dblAns) End Function Public Function KilobytesToMegabytes(Kilobytes) Dim dblAns dblAns = (Kilobytes / 1024) KilobytesToMegabytes = Formatnumber(dblAns,2) End Function Public Function MegabytesToKilobytes(Megabytes) Dim dblAns dblAns = (Megabytes / 1024) MegabytesToKilobytes = Formatnumber(dblAns,2) End Function Function RandomNumber(intHighestNumber) Randomize RandomNumber = Int(intHighestNumber * Rnd) + 1 End Function %>