truncate data from 1 million to 1 dollar using formatCurrency/CCur functions?

J

jrefactors

I want to ask what are the possiblities to truncate data
from 1 million dollars to 1 dollar by using formatCurrency and
CCur functions?

The ASP page has code <%= formatCurrency(rs(14)) %>, the database
rs(14) is 100000000. But when it displays it in the screen,
it shows $1.00 with code <%= formatCurrency(rs(14)) %>

There is another place with code using CCur and formatCurrency
together, i am not sure if this is ok.

<%
amt_of_deposits = amt_of_deposits + cCur(rRes("natl_trust_tran_amt"))
%>
<%=formatCurrency(amt_of_deposits)%>

This problem is so strange to me, I have no idea whats going on.
please advise. thanks!!
 
A

Aaron Bertrand [SQL Server MVP]

Are you sure the data type is numeric? This is likely to happen in the rare
scenario where the number is stored as varchar (or returned with formatting)
and it is 1,000,000 instead of 1000000 ... depending on regional and
language settings, the first comma can be misinterpreted as a decimal (since
those symbols are swapped in many languages).
 
J

jrefactors

The database is Oracle, not SQL Server.

Yes, the data type is NUMBER(11,2), which is good enough to hold 1
million number. I am able to see 1 million number in database. The
weird thing is when it displays it in ASP page, then it becomes $1.00.
 
M

Mark D Powell

Exactly how are you defining the column in your ASP page? Does the ASP
page connect directly to Oracle to read the data or is a SQL Server
linked table being used? Check the variable and column definitions
everywhere between the screen field and the db. Make sure any
conversions are explicitly performed.

HTH -- Mark D Powell --
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top