How regular expressions determine whether to retain 2 decimal places
This article is about how regular expressions determine whether to retain 2 decimal places. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
The specific code is as follows:
6.88888888var bust $('.ba'). Html (); onload = function () {var a = b; var aNew; var re = / ([0-9] +\. [0-9] {2}) [0-9] * /; aNew = a.replace (re, "$1"); $(".ba") .html (aNew)} Thank you for reading! This is the end of the article on "how to retain 2 decimal places in regular expressions". I hope the above content can be of some help to you, so that you can learn more knowledge. If you think the article is good, you can share it for more people to see!