This is pretty simple, since 12 - 9 == 3 for two decimal places + a dot.
var re = new RegExp('^-?\\d{1,9}(\\.\\d{1,2})?$');
authorizes
-123456789-123456789.1-123456789.1200.12
but will not accept
01234567890123 more than 12 divisions123. period without decimal places123.123 more than two decimal places. or .12 (missing 0)
source share