如何添加格式化货币 [英] How to add formatted currency

查看:69
本文介绍了如何添加格式化货币的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在两个文本框中添加100,000 + 100,000,我得到200请帮助我

解决方案

  1. 解析(操作数)文本框 Text 获取十进制值的属性(参见 Decimal.Parse [ ^ ])。
  2. 添加两个十进制操作数,以获得他们的(十进制总和
  3. 获取格式良好的字符串,使用适当的参数调用 sum.Format (参见\"Standard Numeric Format Strings [ ^ ])。
  4. < /醇>

I want to add 100,000 + 100,000 in two textbox, I get 200 please help me

解决方案

  1. Parse the (operand) text boxes Text property to obtain Decimal values (see Decimal.Parse[^]).
  2. Add the two Decimal operands in order to obtain their (Decimal) sum
  3. Obtain a good-formatted string, calling sum.Format with the ppropriate arguments (see "Standard Numeric Format Strings"[^]).


这篇关于如何添加格式化货币的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆