I have some values with decimals that I am needing to trim off completely in order for a join to work properly. How do I remove the decimal and any numbers that follow? For example I have values 2.1, 2.2, 2.3. I just want it to display a "2". I have other numbers in that same column that are whole numbers that do not need trimmed.
Solved! Go to Solution.
Are 2.1 etc all in the same field? Are they numbers or strings? for numbers try round([field],1)
for strings try tostring(round(tonumber([field],1)))
and for mixed info try:
regex_replace([field],"(\d+)\..*","$1")
If they are in the same field and you don't need to round up, like 2.6 needs to be 2 instead of 3, I have attached a solution that uses the text to columns tool and talks about the miracle of the "split to rows" option, which is a common design strategy with a mixed bag of delimiters in a single field.
Hi @KmbrlyPC ,
You can use a select tool and change the column format to integer, that will automatically round your number.
If you would like to get your values without rounding, you can use the floor function to achieve that.
Best,
Fernando Vizcaino