Checking decimal places


(j) #1

Hi, anyone know how to check for certain decimal places? I think I could use the Regex Matching step but not sure how to incorporate that step into my plan using simple scoring.


(Anh Duc Tran) #2

Hi Jeanie,

Can you please describe it in a use case project or give us an example?

Best regards,
David Tran


(Mackenzie Nichols) #3

hey Jeanie!

If you’re looking to match any number with a decimal in it, this regex will return what you want to the $0 element:
[0-9].[0-9]

…but if you only want to match numbers with 2 decimal places in it, check of “Partial Match” and use…

[0-9]*.[0-9]{2}

All this assumes your input value is only numbers. If there are non-numeric characters in there, it will interrupt the matching

The Regex Matching step can write $0 to an output column, which you can use in a subsequent Simple Scoring step.

You can also use the matches() function in Simple Scoring to see if an input entirely matches some regex function.