validate decimal number with 6 decimal digits javascript

Solutions on MaxInterview for validate decimal number with 6 decimal digits javascript by the best coders in the world

showing results for - "validate decimal number with 6 decimal digits javascript"
Mohammed
18 Jan 2018
1var regexp = /^\d+(\.\d{1,2})?$/;
2
3console.log("'.74' returns " + regexp.test('.74'));
4console.log("'7' returns " + regexp.test('7'));
5console.log("'10.5' returns " + regexp.test('10.5'));
6console.log("'115.25' returns " + regexp.test('115.25'));
7console.log("'1535.803' returns " + regexp.test('1535.803'));
8console.log("'153.14.5' returns " + regexp.test('153.14.5'));
9console.log("'415351108140' returns " + regexp.test('415351108140'));
10console.log("'415351108140.5' returns " + regexp.test('415351108140.5'));
11console.log("'415351108140.55' returns " + regexp.test('415351108140.55'));
12console.log("'415351108140.556' returns " + regexp.test('415351108140.556'));
Josefina
09 Apr 2020
1/^\d+(\.\d{1,2})?$/
2
queries leading to this page
how to validate decimal number in java scriptcheck if a number has decimals js 1 00javascript format number 2 digits if decimal is 0 dont showhow to show only two digits after decimal in javascriptdigits until 4 decimal point javascriptjavascript validate decimal number inputreturn number with decimals and to digit in javascriptjavascript find valid number with decimal or 2cvalid number to 2 decimal places jsjavascript validate number with 2 decimal placesvalidate value as decimal in javascriptvalidate decimal value in javascriptjavascript determine number of decimal placesjavascript number validation with decimalvalidate decimal javascripthow to check 3 decimal validation in javascriptvalidate decimal number in javascriptnumber with decimal validation javascriptjs validate 2 decimal placesdisplay two decimal only if there are digits in decimal places jshow tp apply validation for decimal places in jsjavascript 2 decimal places validationjavascript number with decimal validationjavascript validation to check decimal valuecheck float number with max 2 decimals javascriptvalidate decimal number with 6 decimal digits javascriptfield validation in javascript number and decimal point onlyvalidation for numbers with decimal javascriptjavascript validation for only numbers with decimalsvalidate 2 decimal places javascripthow to validate decimal number in javascriptdecimal number validation in javascriptnumber validation with decimal in javascripthow to validate decimal number in nodejsvalid decimal integer size in javascript integervalidate decimal number with 6 decimal digits javascript