格式化功能 [英] Format function

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

问题描述

你好,


为什么这不起作用?

txtMoney.Text.Format(&#; ## 0.00" )


如果我在txtMoney中输入100,它会返回#,## 0.00


我从来没有得到格式化功能。 NET。

Hello,

Why does this not work?

txtMoney.Text.Format("#,##0.00")

If I type 100 in txtMoney, it returns #,##0.00

I have never gotten the format function to work in .NET.

推荐答案



Dim strMoney As String =" 12345.34"

Me.Text = CType(strMoney,Decimal).ToString("#,## 0.00")

Ken

- -------------------

________________________________________

来自:KJ [mailto:kl ****** @ hotmail.com]

发送时间:2004年6月22日星期二下午4:32

收件人:microsoft.public.dotnet.languages.vb

主题:格式化功能


您好,


为什么这不起作用?


txtMoney .Text.Format(&#; ## 0.00")


如果我在txtMoney中输入100,它会返回#,## 0.00


我从来没有得到格式化功能在.NET工作。


-

外发邮件已通过无病毒验证。

由AVG Anti-Virus检查(< a rel =nofollowhref =http://www.grisoft.comtarget =_ _ blank> http://www.grisoft.com)。

版本:7.0.230 /病毒数据库:263.3.3 - 发布日期:2004年6月18日
Hi,
Dim strMoney As String = "12345.34"

Me.Text = CType(strMoney, Decimal).ToString("#,##0.00")

Ken
--------------------
________________________________________
From: KJ [mailto:kl******@hotmail.com]
Sent: Tuesday, June 22, 2004 4:32 PM
To: microsoft.public.dotnet.languages.vb
Subject: Format function

Hello,

Why does this not work?

txtMoney.Text.Format("#,##0.00")

If I type 100 in txtMoney, it returns #,##0.00

I have never gotten the format function to work in .NET.

--
Outgoing mail is certified Virus Free.
Checked by AVG Anti-Virus (http://www.grisoft.com).
Version: 7.0.230 / Virus Database: 263.3.3 - Release Date: 6/18/2004


2004年6月22日13:32:00 -0700,KJ写道:
On 22 Jun 2004 13:32:00 -0700, KJ wrote:
你好,

为什么这不起作用?

txtMoney.Text.Format(&#; ## 0.00" ;)

如果我在txtMoney中输入100,它将返回#,## 0.00

我从来没有让格式函数在.NET中工作。
Hello,

Why does this not work?

txtMoney.Text.Format("#,##0.00")

If I type 100 in txtMoney, it returns #,##0.00

I have never gotten the format function to work in .NET.




因为Format函数是String类的成员。 txtMoney.Text

是一个字符串,格式是该类的成员。


要使用它,你应该尝试:

txtMoney.Text = String.Format("#,## 0.00",txtMoney.Text)

-

Chris


dunawayc [AT] sbcglobal_lunchmeat_ [DOT] net


要给我发电子邮件,请删除[","] ,下划线,午餐肉,和

替换我的电子邮件地址中的某些单词。



Because the Format function is a member of the String class. txtMoney.Text
is a string and Format is a member of that class.

To use it, you should try:

txtMoney.Text = String.Format("#,##0.00", txtMoney.Text)
--
Chris

dunawayc[AT]sbcglobal_lunchmeat_[DOT]net

To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.


* kl ****** @ hotmail.com (KJ)scripsit:
* kl******@hotmail.com (KJ) scripsit:
为什么这不起作用?

txtMoney.Text.Format(&#; ## 0.00")

如果我在txtMoney中键入100,则返回#,## 0.00
Why does this not work?

txtMoney.Text.Format("#,##0.00")

If I type 100 in txtMoney, it returns #,##0.00




请尝试''Strings.Format''。


-

Herfried K. Wagner [MVP]

< URL:http://dotnet.mvps.org/>



Try ''Strings.Format'' instead.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>


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

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