How to write the JS regular expression "only two decimal places are allowed"

allowed input is 0.01, 1.01, etc.

Mar.31,2021

  1. if the title is understood to be limited to two decimal places, use / ^ (-)? (0 | [1-9]\ d *) (\ s | $|\.\ d {1pc2}\ b) / perfectly matches the following situations:

      

    Strig.split ('.') [1] .length limit

Menu