MDL-33105 flexible apply_units() function

Allow use of thousands separator as long as the decimal separator
is used in the number.