Your Universal Remote Control Center
RemoteCentral.com
Custom Installers' Lounge Forum - View Post
Up level
Up level
The following page was printed from RemoteCentral.com:

Login:
Pass:
 
 

Original thread:
Post 6 made on Wednesday May 2, 2018 at 17:07
thecynic315
Senior Member
Joined:
Posts:
August 2008
1,001
On May 2, 2018 at 16:24, mborner said...
Thanks. At the risk of sounding needy, I've been spending hours studying and learning regular expressions but I'm guessing regex can't to that, am I right?
The parsed data from the receiver looks like this: 98MV495MVMAX 98MV49MVMAX
Notice no decimal points or zeroes in the string.

so that says 49.5 and 49?

So do the regex to get the value. 495

Then you can check the last digit. 5

Is the number > 101? Yes so create a string with the first two digits add a . and the last digit or just a 0.

If the number is < 100 just check the 9 cases where it might not be a half step: 15,25,35,45...

I mean there are some other things you can do I guess for better checks but I am too tired to do math right now.


Hosting Services by ipHouse