简体   繁体   English

浮点数的体面JavaScript掩码

[英]Decent JavaScript mask for floating point numbers

I'm developing a system in ASP.NET and I need a textbox mask to handle an input of floating-point numbers. 我正在ASP.NET中开发系统,我需要一个文本框掩码来处理浮点数的输入。 I haven't yet found a javascript mask that would RESPECT the decimal point. 我还没有找到可以尊重小数点的javascript掩码。 I've tried several, including dFilter and "Mask JavaScript API" and none of them could do the job in a swift manner. 我已经尝试了几种,包括dFilter和“ Mask JavaScript API”,但它们都无法迅速完成这项工作。

The numbers I need to deal are like the following: 我需要处理的数字如下:

0.123,456,789,012

12,345,678,890,123.000

1,234,567,890,123.123,456,789,012

I appreciate your help, if you could post a script here or indicate a JavaScript library I could use. 感谢您的帮助,如果您可以在此处发布脚本或指出我可以使用的JavaScript库。

ASP.NET Ajax Toolkit has a mask control. ASP.NET Ajax工具包具有一个掩码控件。

MaskedEdit Demonstration MaskedEdit演示

您可以使用jquery插件NumberFormatter,如本问题所述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM