Conversion function problems

R

Red_Star20

i have some fields in an oracle database... the datatype for the fields is
number and when i pull up the records they show up in the following format:
3128.87 which is what i want in my asp as well. However instead of getting
87 on to the right of the decimal point I get 0 zeros.
here is my code: <%=FormatCurrency(CDbl(rsDataSet("In_Academic"),2))%>
Not sure what the problem is.... Any clue?! thanks in advance!
 
R

Red_Star20

The code is the following: <%=FormatCurrency(rsDataSet("In_Academic"),2)%>
sorry for the mistake... so it seems as if it is rounding down, but not sure
why
 
C

Conrad

If you add the CDbl does that help? I would think it would. Also I've had
trouble using FormatCurrency if the field was null so you might want to check
for that first.
 
R

Red_Star20

So I should try it like this?!
<%=FormatCurrency(CDbl(rsDataSet("In_Academic"),2))%>
It is definitely not null, because i checked....
 
C

Conrad

I would also use the IsNumeric to make sure what you are passing is a number.
<% If IsNumeric(rsDataSet("In_Academic")) Then
FormatCurrency(CDbl(rsDataSet("In_Academic"),2))
End If %>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top