将数据显示为2个小数点 [英] Displaying data to 2 decimal points

查看:91
本文介绍了将数据显示为2个小数点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


我有一个ASP / SQL 7应用程序,它将SQL视图中的数据转换为ASP

页面。

我在SQL表中有一个包含货币收入值的货币栏。


当数据输入到该字段时,它需要显示为货币(到2) >
小数位 - 10.00或7.60)

但是,这似乎只发生在用户输入额外0,

且输入为7.6时,它仍然显示为7.6

我需要将所有数据显示为货币值(并且它被选为货币

in SQL),所以有什么方法(无论是在表格设计,View设计,还是在ASP页面上显示
)都可以将数据提取到2位小数,无论是什么?b $ b br />

感谢您的帮助,提前


-

G

< a rel =nofollowhref =http://www.bradflack.comtarget =_ blank> www.bradflack.com


请删除ANTI和垃圾邮件 在给我发送电子邮件之前从我的

电子邮件地址。

Hi there,

I have an ASP/SQL 7 application that rips data from SQL Views onto an ASP
page.
I have a money column in a SQL table that contains money income values.

When data is input to this field it needs to be displayed as money (to 2
decimal places - 10.00 or 7.60)
However, this only seems to be occurring when the user puts in the extra 0,
and if 7.6 is entered, it is still displayed as 7.6

I need all data to be displayed as money values (and it is selected as money
in SQL), so is there any way (either in the table design, View design, or
display on the ASP page) to get the data to 2 decimal places, no matter
what?

Thanks for you help, in advance

--
G

www.bradflack.com

Please remove ANTI and SPAM from my
email address before sending me an email.

推荐答案

Guy Hocking写道:
Guy Hocking wrote:
您好,

我有一个ASP / SQL 7应用程序,它将SQL视图中的数据转移到一个ASP页面上。
我在SQL表中有一个money列包含货币收入
值。

当数据输入到该字段时,它需要显示为金钱
(到小数点后两位 - 10.00或7.60)
然而,这似乎只是在用户输入额外0时发生,如果输入7.6,它仍然显示为7.6

我需要将所有数据显示为货币值(并且它被选为
作为SQL中的钱),所以有任何方式(在表格设计,视图设计或ASP页面上显示)来获取数据为2十进制地点,不管是什么?

感谢您的帮助,提前
Hi there,

I have an ASP/SQL 7 application that rips data from SQL Views onto an
ASP page.
I have a money column in a SQL table that contains money income
values.

When data is input to this field it needs to be displayed as money
(to 2 decimal places - 10.00 or 7.60)
However, this only seems to be occurring when the user puts in the
extra 0, and if 7.6 is entered, it is still displayed as 7.6

I need all data to be displayed as money values (and it is selected
as money in SQL), so is there any way (either in the table design,
View design, or display on the ASP page) to get the data to 2 decimal
places, no matter what?

Thanks for you help, in advance




使用以下vbscript功能之一:

FormatCurrency

FormatNumber


HTH,

Bob Barrows


-

Microsoft MVP - ASP / ASP.NET

请回复新闻组。这个电子邮件帐户是我的垃圾邮件陷阱所以我

不经常检查它。如果您必须离线回复,请删除

无垃圾邮件



Use one of these vbscript functions:
FormatCurrency
FormatNumber

HTH,
Bob Barrows

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don''t check it very often. If you must reply off-line, then remove the
"NO SPAM"


您好,


感谢您的回复 -


我的方案中的任何功能示例?


干杯


-

G

www .bradflack.com


请在发送电子邮件之前从我的

电子邮件地址中删除ANTI和垃圾邮件。

Bob Barrows <再****** @ NOyahoo.SPAMcom>在消息中写道

新闻:O9 ************* @ tk2msftngp13.phx.gbl ...
Hi,

Thanks for the response -

Any examples of the functions in my scenario?

Cheers

--
G

www.bradflack.com

Please remove ANTI and SPAM from my
email address before sending me an email.
"Bob Barrows" <re******@NOyahoo.SPAMcom> wrote in message
news:O9*************@tk2msftngp13.phx.gbl...
Guy Hocking写道:
Guy Hocking wrote:
你好,

我有一个ASP / SQL 7应用程序,它将SQL视图中的数据转移到一个
ASP页面。
我有一个钱列一个包含货币收入值的SQL表。

当数据输入到该字段时,它需要显示为货币
(到小数点后两位 - 10.00或7.60)<但是,这似乎只是在用户输入
额外0时发生,如果输入7.6,它仍然显示为7.6

我需要所有数据显示为货币值(并在SQL中选择它作为货币),所以有任何方式(在表格设计,视图设计或ASP页面上显示)以获取数据2位小数
地方,无论如何?

感谢您的帮助,提前
Hi there,

I have an ASP/SQL 7 application that rips data from SQL Views onto an
ASP page.
I have a money column in a SQL table that contains money income
values.

When data is input to this field it needs to be displayed as money
(to 2 decimal places - 10.00 or 7.60)
However, this only seems to be occurring when the user puts in the
extra 0, and if 7.6 is entered, it is still displayed as 7.6

I need all data to be displayed as money values (and it is selected
as money in SQL), so is there any way (either in the table design,
View design, or display on the ASP page) to get the data to 2 decimal
places, no matter what?

Thanks for you help, in advance



使用以下vbscript功能之一:
FormatCurrency <无线电通信/> FormatNumber

HTH,
Bob Barrows

- 微软MVP - ASP / ASP.NET
请回复新闻组。这个电子邮件帐户是我的垃圾邮件陷阱所以我不经常检查它。如果您必须离线回复,请删除
NO SPAM



Use one of these vbscript functions:
FormatCurrency
FormatNumber

HTH,
Bob Barrows

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don''t check it very often. If you must reply off-line, then remove the
"NO SPAM"



Guy Hocking写道:
Guy Hocking wrote:


感谢您的回复 -

我方案中的所有功能示例?
Hi,

Thanks for the response -

Any examples of the functions in my scenario?



鉴于您没有提供有关您的方案的任何详细信息(

您遇到问题?连接到数据库?在

记录集中检索数据?从中读取数据记录集中的字段?),我不能提供超出在线文档中显示的任何示例。也许

这就是你需要的......?这是一个链接:

http://tinyurl.com/7rk6


只需在下载并安装

后查看其中的功能即可。 Google搜索或搜索 www.aspfaq.com 也可以为您提供

及其使用示例。

Bob Barrows

-

Microsoft MVP - ASP / ASP.NET

请回复新闻组。这个电子邮件帐户是我的垃圾邮件陷阱所以我

不经常检查它。如果您必须离线回复,请删除

无垃圾邮件


Given that you have not provided any details about your scenario (where are
you having a problem? Connecting to the database? Retrieving data in a
recordset? Reading the data from the fields in the recordset?), I can''t
offer any examples beyond what is shown in the online documentation. Perhaps
that is what you need ... ? Here is a link:

http://tinyurl.com/7rk6

Just look up the functions in there once you have downloaded and installed
it. A Google search or a search of www.aspfaq.com could also provide you
with some examples of their use.
Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don''t check it very often. If you must reply off-line, then remove the
"NO SPAM"


这篇关于将数据显示为2个小数点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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