asp.net中的货币格式 [英] Currency formating in asp.net
本文介绍了asp.net中的货币格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在sql server 2005中,我正在创建一个表.喜欢:-
In sql server 2005 i am create a table. like:-
Name Amount
Prince 10
Rakesh 20
上表中的名称为varchar(50),金额为货币数据类型.
在上表中,我显示在数据列表中.但显示像
in above table Name is varchar(50) and Amount is money data type.
In above table i am display in datalist. but is display like
Name Amount
Prince 10.0000
Rakesh 20.0000
但我想显示为:-
but i want to display like:-
Name Amount
Prince Rs 10.00
Rakesh Rs 20.00
我也尝试像{0:c}这样格式化,但是它显示$符号,但是我需要在$位置显示Rs.因此,请帮助我,如何解决以上情况.
I am also try for formating like {0:c} but it is display $ symbol but i need to display Rs in place $. So please help me, how to solve above scenario.
推荐答案
符号,但我需要在适当位置显示Rs
symbol but i need to display Rs in place
.因此,请帮助我,如何解决上述情况.
. So please help me, how to solve above scenario.
您可以考虑串联和拆分值.
You can think about concatenation and split values.
select name, (''Rs '' + cast( amount as varchar(50))) as aa from currency
这篇关于asp.net中的货币格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文