js string only positive float numbers

Solutions on MaxInterview for js string only positive float numbers by the best coders in the world

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
showing results for - "js string only positive float numbers"
Valentín
27 Mar 2019
1if ("10".match(/^(?!0\d)\d*(\.\d+)?$/)) {
2	console.log('match')
3} // expected output: 'match'
4
5// matches
6	// 10.0
7	// 0.10
8	// 123.456
9// Does not match
10	// a1
11	// 00.10