主题:  高手。我的问题还没有完全解决请教!!!!!

yukeiv

职务:普通成员
等级:1
金币:0.0
发贴:35
#12002/10/30 13:26:48
有高手知道为什么我设计的数据库中字段是货币型。如:123,321,333.00但在网页上却只能看到:123321333不符合财务标准。程序是用ASP写的。我想让它在网页上显示是123,333,333.00这样的格式。不但有“,”还要有".00" 我用的是acess而且在设计的时候我已经把字段属性设为(Currency)货币型了。但还是不行为什么?大哥帮忙!!!源程序如下:
<% dim strScore
1. strScore=FormatCurrency(strScore,2,-1,-1,-2)
2. For i = LBound(ArrSubject) To UBound(ArrSubject)
3. strSubject=trim(cstr(ArrSubject(i)))
4. strScore=rsScore.Fields.Item(strSubject).value
5. if IsNull(strScore) then strScore=0
6. if strScore<0 then
7. strScore = "" & strScore & ""
8. elseif strScore>=0 and strScore<80 then
9. ArrPass(i)=ArrPass(i)+1
10. strScore = "" & strScore & ""
11. elseif strScore>=80 then
12. ArrPass(i)=ArrPass(i)+1
13. ArrExcel(i)=ArrExcel(i)+1
14. strScore = "" & strScore & ""
15. end if
16. response.write "
" & strScore & "

5D荣誉版主

职务:普通成员
等级:1
金币:10.0
发贴:271
#22002/10/30 13:45:54
照你这个样子当然是显示不出标准的财务格式的了.
开始的时候strScore并没有初始化,你就FormatCurrency,等你取到了值后你又不FormatCurrency,这肯定是不行的了

<% dim str
1. 2. For i = LBound(ArrSubject) To UBound(ArrSubject)
3. strSubject=trim(cstr(ArrSubject(i)))
4. strScore=rsScore.Fields.Item(strSubject).value
5. if IsNull(strScore) then strScore=0
6. if strScore<0 then
7. str= "" & FormatCurrency(strScore,2,-1,-1,-2)
& "
"
8. elseif strScore>=0 and strScore<80 then
9. ArrPass(i)=ArrPass(i)+1
10. str = "" & FormatCurrency(strScore,2,-1,-1,-2)
& "
"
11. elseif strScore>=80 then
12. ArrPass(i)=ArrPass(i)+1
13. ArrExcel(i)=ArrExcel(i)+1
14. str = "" & FormatCurrency(strScore,2,-1,-1,-2)
& "
"
15. end if
16. response.write "
" & str & "

yukeiv

职务:普通成员
等级:1
金币:0.0
发贴:35
#32002/10/31 7:26:46
老大。饭已ok!我已咪细,嘻嘻,我太感激你了。万分感谢5D高手云集。我一定多给你们做宣传。



5D荣誉版主

职务:普通成员
等级:1
金币:10.0
发贴:271
#42002/10/31 8:37:30
呵呵,替你高兴。
感激倒是不用,不过我不大明白我称呼的由来,呵呵



yukeiv

职务:普通成员
等级:1
金币:0.0
发贴:35
#52002/11/8 18:39:03
在我们哈尔滨市对比较好的朋友都称做:老大。明白??????