How to remove the last decimal point of .36.00
which is the .00
without affecting the other data that have .00
like 28.003
and 2.0003
here's the code: https://stackblitz.com/edit/ng-zorro-antd-start-8t6pdr?file=src/app/app.component.ts
const s= ['.37.00 Mbit/s', '32.023 Mbit/s', '23.283 Mbit/s', '28.003 Mbit/s', '2.0003 Mbit/s'];
for (let x = 0; x <= s.length; x++) {
const sam = s[x].replace(/[^0-9+.]/g, "");
console.log(sam)
}
expected output.
.37
32.023
23.283
28.003
2.0003