A friend asked me to update his shopping cart software. It’s written in classical ASP using IE’s JScript. I can’t seem to format the variables correctly.
. <% if (oOrder['product'] == "camera")
{ %> <%= format_float(oOrder['cost'], 2, 3)/2 %> <% } %>
%>
When I do this I get a bunch of jibberish with regards to the output. I’m guessing it’s because of a datatype mismatch.
I get -1.#IND as the output.
What does format_float do, and what does it return? I suspect it is returning a formatted string, in which case you need to divide first, like this:
But you still need a way to parse oOrder[‘cost’] if it is a string and format_float is not doing it.