一品网
  • 首页

金额的正则验证


/^(([1-9]\d*)|0)(\.\d{1,2})?$/

在 JavaScript 中测试:

/^(([1-9]\d*)|0)(\.\d{1,2})?$/.test(money);

// input 需要使用 text,而不 number,即 
Test Value Result
a false
0. false
0 true
0.0 true
10.00 true
Other

相关


SharePoint O365:Column 'WEAKEN TYPE' does not exist. It may have been deleted by

Scrapy+splash报错 Connection was refused by other side

Yet Another Intro for Symbol

C. Yet Another Counting Problem from Educational Codeforces Round 86

Git操作失败并提示Another git process seems to be running in this......

CF755G PolandBall and Many Other Balls

Cotherm 多物理场耦合方案

CF 1591D - Yet Another Sorting Problem

启动redis集群服务报错:[ERR] Node 10.0.0.1:6001 is not empty. Either the node alre

2096. Step-By-Step Directions From a Binary Tree Node to Another

CF868F Yet Another Minimization Problem - 决策单调性

CF1399F Yet Another Segments Subset 题解

标签

一品网 冀ICP备14022925号-6