Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How regular expressions determine whether to retain 2 decimal places

Shulou Source: shulou.com Published: 2022-06-02 06:44:36 10月03日 Update

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!

Tags: Decimal regular expression content more article good practical code article look knowledge reference help related Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS OPPO Reno Apple Docker NVidia