在运行时C#2008 SQL Server中在文本框中获取.00 [英] To get .00 in textbox at runtime C# 2008 sql server

查看:75
本文介绍了在运行时C#2008 SQL Server中在文本框中获取.00的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

< b></b>先生,
我是Bhanu Pratap Singh.我正在使用C#编码学习Dot.Net.
我正在设计Web应用程序.我无法在文本框的右侧获取(.00),以便用户只需要在运行时将值放在小数点前即可.值应写在文本框中,例如1500.00.但是.00应该在运行时提供文本框.
请帮帮我.

谢谢你
巴努·普拉塔普·辛格
印度德里

<b></b>Sir,
I am Bhanu Pratap Singh. I am in learning process of Dot.Net with C# coading.
I am designing Web Application. I am not able to get (.00) in right side of textbox so as to user only need to put only value not decimal before value at runtime. value should be written in textbox like 1500.00. But .00 shuld come up with textbox as it at runtime.
Please help me.

Thanking you
Bhanu Pratap Singh
Del India

推荐答案

尝试
TextBox.Text = string.Format("{0:F2}",value);


这篇关于在运行时C#2008 SQL Server中在文本框中获取.00的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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