cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jagaran
Level: Power Up

ISmatch decimal

I got stucked with Ismatch function.

if users txt value is ( two or one digit before and after decimal value) i.e

0.50 or 0.5 or 1.50 or 1.5 then required field is YES else NO

i tried to use ismatch function

IsMatch(dcamount.Text,"\d+(.\d\d)" ) Or IsMatch(dcamount.Text,"\d+(.\d)" ) Or IsMatch(dcamount.Text,"\d\d+(.\d\d)" ) Or IsMatch(dcamount.Text,"\d\d+(.\d)" )

 

but this is not working as i expected.

it shows required field yes, if value is 111 (Three or more digit).

Any help/tips?

1 ACCEPTED SOLUTION

Accepted Solutions
jagaran
Level: Power Up

Re: ISmatch decimal

Finally

this wokred

 

 IsMatch(dcamount.Text,"(\d\d)+\.(\d\d)" ) Or IsMatch(dcamount.Text,"(\d)+\.(\d\d)" ) Or IsMatch(dcamount.Text,"(\d\d)+\.(\d)" ) Or IsMatch(dcamount.Text,"(\d)+\.(\d)" ) Or IsMatch(dcamount.Text,"\.(\d)" ) Or IsMatch(dcamount.Text,"\.(\d\d)" )

 

Thanks @dinusc for your tips..

View solution in original post

4 REPLIES 4
Microsoft dinusc
Microsoft

Re: ISmatch decimal

Hello @jagaran,

The issue is that you allow "." any times. Example based on the nn.nn formula:

"\d\d+(.\d\d)"

should be

"(\d\d)+\.(\d\d)"

jagaran
Level: Power Up

Re: ISmatch decimal

@dinusc

Thanks for your reply. I tried your suggestion but still i get

required field yes and now for two digit figure i.e 11

 

IsMatch(dcamount.Text,"\d+(.\d\d)" ) Or IsMatch(dcamount.Text,"\d+(.\d)" ) Or IsMatch(dcamount.Text,"(\d\d)+\.(\d\d)" ) Or IsMatch(dcamount.Text,"\d\d+(.\d)" )Or IsMatch(dcamount.Text,"(.\d)" ) Or IsMatch(dcamount.Text,"(.\d\d)" )

 

above formula works for

1.1

11.11

.1

.11

and it works for 11 too which i don't want.

it should only with decimal value

jagaran
Level: Power Up

Re: ISmatch decimal

Finally

this wokred

 

 IsMatch(dcamount.Text,"(\d\d)+\.(\d\d)" ) Or IsMatch(dcamount.Text,"(\d)+\.(\d\d)" ) Or IsMatch(dcamount.Text,"(\d\d)+\.(\d)" ) Or IsMatch(dcamount.Text,"(\d)+\.(\d)" ) Or IsMatch(dcamount.Text,"\.(\d)" ) Or IsMatch(dcamount.Text,"\.(\d\d)" )

 

Thanks @dinusc for your tips..

View solution in original post

Microsoft dinusc
Microsoft

Re: ISmatch decimal

As mentioned, my example was only for the NN.NN case. Just did not want to repeat the same idea 4 times. I'm glad you got it working.

Helpful resources

Announcements
thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Kudoed Authors (Last 30 Days)
Users online (4,104)