如何添加格式化货币 [英] How to add formatted currency
本文介绍了如何添加格式化货币的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在两个文本框中添加100,000 + 100,000,我得到200请帮助我
解决方案
- 解析(操作数)文本框
Text
获取十进制
值的属性(参见 Decimal.Parse [ ^ ])。- 添加两个
十进制
操作数,以获得他们的(十进制
)总和
- 获取格式良好的
< /醇>字符串
,使用适当的参数调用sum.Format
(参见\"Standard Numeric Format Strings [ ^ ])。
I want to add 100,000 + 100,000 in two textbox, I get 200 please help me
解决方案
- Parse the (operand) text boxes
Text
property to obtainDecimal
values (see Decimal.Parse[^]).- Add the two
Decimal
operands in order to obtain their (Decimal
)sum
- Obtain a good-formatted
string
, callingsum.Format
with the ppropriate arguments (see "Standard Numeric Format Strings"[^]).
这篇关于如何添加格式化货币的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文