Typos were introduced in composing the posting...sorry.
I copied the website to a different server box running same os, same
IIS, same patch levels. It works fine. Also, as I mentioned, the same
code on the same box as the failing code is also working.
In addition, the code works for any integer source value (0, 1, -1, 5,
etc.). It is only when I call the formatpercent function with a
decimal number.
I went further and hardcoded values in the vbscript function, so the
value passed from jscript is ignored completely -- same results.
See code below, if the value in the vbscript function is changed to
1.01, it fails. So I know that it is not the value passed by jscript.
<%@language=jscript%>
<script language=vbscript runat=server>
function frmtPercent (nPercent)
frmtPercent = formatpercent(1.00)
end function
</script>
<%
x = 0.050
Response.write (frmtPercent(x));
%>
For some reason, vbscript formatpercent just does not like decimal
numbers just on this one site on this server.
--David
Dave Anderson wrote:
dk*@kccomputersales.com wrote:
<script language=vbscript runat=server>
function frmtPercent (nNumber)
fmrtPercent = formatpercent(nNumber,2)
end function
</script>
<%
frmtPercent(0) --0.00%
frmtPercent(1) --100.00%
fmrtPercent(0.5) --overflow 800a0006
%>
Does it help if you change your function like this? VBScript functions like
this may not be able to handle all numeric data types.
Function frmtPercent (nNumber)
frmtPercent = formatpercent(CSng(nNumber),2)
End Function
Also, it helps to spell your function correctly in your interior assignment
(frmtPercent is not the same as fmrtPercent).
--
Dave Anderson
Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.