Newbee使用Javascript货币的帮助£& $符号 [英] Newbee Help with Javascript Currency £ & $ symbols

查看:79
本文介绍了Newbee使用Javascript货币的帮助£& $符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好!感谢您抽出宝贵的时间阅读此内容.

我对表格进行排序的JavaScript函数有问题.直到您将英镑符号用作货币,它都可以正常工作.

如果我用美元符号代替标准,则$符号可以正常工作,但英镑或什至不是欧元符号:

Hi & thanks for taking the time to read this.

I am having problems with a javascript function that sorts tables. It works fine until you use a £ symbol for currency.

The $ sign works fine if I replace the criteria with that, but not the £ or even the euro symbol:

if (itm.match(/^[£]/)) {
    alert("currecncy";);
    sortfn = this.sortCurrency;
}



如果货币的格式为£,但如果我将其格式为$,并将itm.match更改为$,则会收到警报.

请帮助.....

奇怪的是,我在键入此字时才注意到£英镑正在以一种奇怪的方式进行预览.嗯,我也将A添加到了标准中,然后将其选择为货币..



If the currency is formatted with a £ nothing, but if I format it with a $ and change the itm.match to $ then I get the alert.

Please help.....

Wierd I just noticed when typing this that £ are being previewed with a wierd A infront of them wonder if this is releated? Ha it is aswell I added the A to the criteria and it picked it up as currency..

Perhaps somebody would be good enough to explain this wierdness????

推荐答案

sign可以很好地代替我的标准,但不能代替£甚至欧元符号:

sign works fine if I replace the criteria with that, but not the £ or even the euro symbol:

if (itm.match(/^[£]/)) {
    alert("currecncy";);
    sortfn = this.sortCurrency;
}



如果货币的格式为£,但如果我将其格式为



If the currency is formatted with a £ nothing, but if I format it with a


,然后将itm.match更改为
and change the itm.match to


,那么我得到了警报.

请帮助.....

奇怪的是,我在键入此字时才注意到£英镑正在以一种奇怪的方式进行预览.嗯,我也将A添加到了标准中,然后将其选择为货币..

也许有人会很好地解释这种怪异???
then I get the alert.

Please help.....

Wierd I just noticed when typing this that £ are being previewed with a wierd A infront of them wonder if this is releated? Ha it is aswell I added the A to the criteria and it picked it up as currency..

Perhaps somebody would be good enough to explain this wierdness????


这篇关于Newbee使用Javascript货币的帮助£& $符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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