I've used the function you showed exactly the same way. It gives error "invalid use of NULL" and points to this line of the code.<BR> cents = Round( 100 * ( amount - dollars ) ) <BR><BR>Now I've inserted the whole function in a file. included this file using <!--include functionfile name --><BR><BR>Amount which need to be converted to words, comes from SQLserver database datatype is number. <BR>What could be the reason to get the above error?<BR><BR><%<BR>Dim UnitNames, TeenNames, DecadeNames<BR>UnitNames = Array(" zero"," one"," two"," three"," four", _<BR> " five"," six"," seven"," eight"," nine" )<BR>TeenNames = Array(" ten"," eleven"," twelve"," thirteen"," fourteen", _<BR> " fifteen"," sixteen"," seventeen"," eighteen"," nineteen" )<BR>DecadeNames = Array(" zero"," ten"," twenty"," thirty"," forty", _<BR> " fifty"," sixty"," seventy"," eighty"," ninety" )<BR><BR>Function NumberAsWord( num )<BR> Dim millions, thousands, hundreds, decades, result<BR><BR> If Not isNumeric( num ) Then<BR> NumberAsWord = "<i>That is NOT a valid number!</i>"<BR> Exit Function<BR> End If<BR><BR> result = ""<BR> num = CDbl(num)<BR><BR> If num = 0 Then<BR> NumberAsWord = "Zero"<BR> Exit Function<BR> End If<BR><BR> If num < 0 Then<BR> num = - num<BR> result = "<i>NEGATIVE</i> "<BR> End If<BR><BR> millions = 999999<BR><BR> On Error Resume Next<BR> millions = num 1000000<BR> num = CLng( num MOD 1000000 )<BR> On Error GoTo 0<BR><BR> If millions > 0 Then<BR> If millions > 999 Then<BR> NumberAsWord = result & "BILLIONS and BILLIONS"<BR> Exit Function<BR> End If<BR> result = result & NumberAsWord( millions ) & " Million"<BR> If num = 0 Then<BR> NumberAsWord = result<BR> Exit Function<BR> End If<BR> End If<BR> <BR> thousands = num 1000<BR> num = num MOD 1000<BR> If thousands > 0 Then<BR> result = result & NumberAsWord( thousands ) & " Thousand"<BR> If num = 0 Then<BR> NumberAsWord = result<BR> Exit Function<BR> End If<BR> End If<BR> <BR> hundreds = num 100<BR> num = num MOD 100 <BR> If hundreds > 0 Then<BR> result = result & UnitNames( hundreds ) & " Hundred"<BR> End If<BR> <BR> decades = num 10<BR> num = num MOD 10<BR> If decades = 1 Then<BR> result = result & TeenNames( num ) <BR> Else<BR> If decades > 1 Then<BR> result = result & DecadeNames( decades )<BR> End If<BR> If num > 0 Then<BR> result = result & UnitNames( num )<BR> End If<BR> End If<BR> NumberAsWord = result<BR>End Function<BR><BR><BR>Function DollarsToWords( amount ) <BR> Dim dollars, cents, words <BR><BR> dollars = Int( amount ) <BR><BR> cents = Round( 100 * ( amount - dollars ) ) <BR><BR> words = NumberAsWord( dollars ) & " Dollars" <BR><BR> If cents = 0 Then <BR> words = words & " And Zero Cent" <BR> Elseif cents = 1 Then ' special case so no "s" on cent <BR> words = words & " And One Cent" <BR> Else <BR> words = words & " And " & NumberAsWord( cents ) & " Cents" <BR> End If <BR><BR> DollarsToWords = words <BR>End Function <BR>%>