The correct convention for displaying measurements in text is to have a space between the number and the unit such as 10 m. When presenting attribute tables, in a layout for example the "m" often gets split onto a new line if you have fixed column widths. Is there a way to keep the number and its unit together?
As shown below, the second row doesn't look great.
replace()
with a regular expression. If you are talking about a representation of the attribute table contents e.g. in a print layout, you have more options.