By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
439,978 Members | 1,373 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 439,978 IT Pros & Developers. It's quick & easy.

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

P: n/a
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!!

Aug 16 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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).
<jr********@hotmail.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
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!!

Aug 17 '05 #2

P: n/a
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.
Aaron Bertrand [SQL Server MVP] wrote:
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).
<jr********@hotmail.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
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!!


Aug 17 '05 #3

P: n/a
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 --

Aug 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.