function TrimString(S)
	TrimString=trim(S)
end function
function charToHex(ch)
	charToHex=cstr(hex(asc(ch)))
end function
'function ReplSpaceSymb(NameValue,sourceStr,targetStr)
'	ReplSpaceSymb=replace(NameValue,sourceStr,targetStr)
'end function
Function toCurrency( S ) 
    If Len(Trim(S)) = 0 Then
        toCurrency = ""
    Else
        toCurrency = FormatNumber(S, 2)
        If (CDbl(S) > -1) And (CDbl(S) < 1) And (InStr(toCurrency, "0.") = 0) Then
            toCurrency = "0" & toCurrency
        End If
		If Left(toCurrency, 1) = "-" Then
			toCurrency = Mid(toCurrency, 2) & "-"
		End If
    End If
end Function
