使用 JQuery 删除欧元价值和货币格式
Remove Euro Value and money format with JQuery
我已经知道如何从标签中获取值,问题是它显示类似的东西
€123,453.28
我需要删除欧元符号和逗号才能进行计算。
当然不删除小数点
$(document).ready(function () {
$("#TxtVatExcluded").keypress(function () {
var invoicedAmmount = $("#MainContent_VehicleInformationControl_LblInvoicePriceValue").text();
alert(invoicedAmmount);
if (invoicedAmmount > 0) {
var ammountWithoutVat = $("#TxtVatExcluded").val();
var result = (ammountWithoutVat / invoicedAmmount) * 100;
$("#OutputLabel").html(result + " %");
}
});
});
"€123,453.28".replace(/[^'d.]/g,"") // Replace every non digit char or dot char
// With an empty string.
现场演示
所以在你的代码中:
var ammountWithoutVat = $("#TxtVatExcluded").val().replace(/[^'d.]/g,"");
var result = (pareseFloat(ammountWithoutVat, 10) / invoicedAmmount) * 100;
相关文章:
- 将数字四舍五入到小数点后两位,以设置货币格式
- 如何使用jquery对货币格式的数字求和
- 获取日期和货币格式
- 通过javascript在文本字段中显示货币格式
- Java脚本插件,用于将数字转换为特定于区域性的货币格式,并将具有特定货币格式的非格式化数字转换为普通数字
- 正则表达式货币格式 - javascript
- 正则表达式仅用于数字,也屏蔽货币格式
- 多种AngularJS货币格式,使用i18n(欧元,DE)
- 我如何在胡子中将十进制格式设置为货币格式
- 如何在JS中转换为货币格式
- JavaScript 美国货币格式
- 带有逗号和小数的正确 JS 货币格式
- 如何使用 jQuery 键入时设置货币格式
- Javascript 中的总计计算,用于处理货币格式(MinusSignNegative)
- 印度卢比货币格式
- 使用 JQuery 删除欧元价值和货币格式
- 我想将输入的字符串分隔为印度货币格式,就像我输入123456表示一样,那么我想得到 1,23,456
- 实现货币格式 Chromecast Sender Chrome
- 带有ng-model的输入框中的Angularjs货币格式:如何让$formatters在每个输入上触发
- 将数字格式转换为货币格式