JavaScript版本的VBScript格式化函数 [英] JavaScript version of VBScript's formatting functions

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

问题描述




有没有人知道权威性的JavaScript格式化函数的来源

例如格式化数字,日期,货币等?


互联网上有很多例子,当然,我还没有找到

任何100%可靠。


马克

Hi,

Does anyone know of a "definitive" source of JavaScript formatting functions
e.g. to format numbers, dates, currencies etc?

There are loads of examples on the Internet, of course, but I''ve yet to find
any which are 100% reliable.

Mark

推荐答案

没有任何网站可以100%保证。 ..哎呀,没什么完美的。

至于你会找到最好的......好吧,这是另一个故事。

我一直用 www.DevGuru.com 了解我的javascript语法并发现它非常好

很好。


-

Curt Christianson

网站: http://www.darkfalz.com

博客: http://blog.darkfalz.com

" Mark Rae"写道:
No site is going to be 100% guaranteed... heck, nothings perfect.
As for "best you will find"... well, that''s another story.
I''ve always used www.DevGuru.com for my javascript syntax and found it quite
nice.

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"Mark Rae" wrote:


有谁知道权威 JavaScript格式化函数的来源
格式化数字,日期,货币等?

当然,互联网上有很多例子,但我还没有发现任何100%可靠的例子。 />
Mark
Hi,

Does anyone know of a "definitive" source of JavaScript formatting functions
e.g. to format numbers, dates, currencies etc?

There are loads of examples on the Internet, of course, but I''ve yet to find
any which are 100% reliable.

Mark



这是一个非常简单的列表。 toString()返回本地版本,那里

是一个选项基数,用于指定用于数字的基数


完整规格:
http://www.ecma-international.org/ pu ... s / Ecma-262.htm


javascript有以下对象类型:


对象toString()结果

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

数组对所有对象的toString执行砂形连接结果

布尔返回" true"或false

日期以区域设置格式返回日期

函数return func def as string

错误返回错误消息

基于基数的数字返回数字作为字符串(默认值= 10)

字符串返回字符串值

默认返回" [object objectname]"


Date对象有一些额外的字符串函数(这些函数都不带

参数,并返回明显的):


toDateString()

toGMTString()

toLocaleDateString()

toLocaleString()

toLocaleTimeString()

toTimeString()

toUTCString()

Number对象还有以下内容:


toFixed(factionDigits)

toLocalString()

toPrecision(精度)

大多数网站编写自己的格式化工具

- 布鲁斯(sqlwork.com)



" ; Mark Rae <毫安** @ mark-N-O-S-P-A-M-rae.co.uk>在留言中写道

新闻:%2 **************** @ TK2MSFTNGP10.phx.gbl ...
its a pretty simple list. toString() that returns the local version, there
is an options radix, used to specify the radix used for numberss

full spec :
http://www.ecma-international.org/pu...s/Ecma-262.htm

javascript has the following objects types:

object toString() results
------- ----------------------------
Array does to a toString of all object sand concats the results
Boolean return "true" or "false"
Date returns date in locale format
Function return func def as string
Error return error message
Number return number as string based on radix (default = 10)
String returns string value
Default return "[object objectname]"

the Date object has some additional string functions (none of these take a
parameter, and return the obvious):

toDateString()
toGMTString()
toLocaleDateString()
toLocaleString()
toLocaleTimeString()
toTimeString()
toUTCString()

the Number object has the additional following:

toFixed (factionDigits)
toLocalString()
toPrecision(precision)
most sites write their own formating utilities

-- bruce (sqlwork.com)



"Mark Rae" <ma**@mark-N-O-S-P-A-M-rae.co.uk> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...


有没有人知道权威性的JavaScript格式的来源
函数,例如格式化数字,日期,货币等?

当然,互联网上有大量的例子,但我还没有找到任何100%可靠的例子。 Mark
Hi,

Does anyone know of a "definitive" source of JavaScript formatting
functions e.g. to format numbers, dates, currencies etc?

There are loads of examples on the Internet, of course, but I''ve yet to
find any which are 100% reliable.

Mark



" Bruce Barker" <峰; br ****************** @ safeco.com>在消息中写道

新闻:ey **************** @ TK2MSFTNGP09.phx.gbl ...
"Bruce Barker" <br******************@safeco.com> wrote in message
news:ey****************@TK2MSFTNGP09.phx.gbl...
大多数网站编写自己的格式化实用程序
most sites write their own formating utilities




确实 - 我想知道是否有人找到了一个100%

的效率,因为我没有......



Yes indeed - I was wondering if anyone had found one which was 100%
efficient, because I haven''t...


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

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