I am looking for a regex that would normalize decimal number. When I say normalize I mean remove all leading zeros, and all trailing zeros after decimal point.
For example:
0.0 -> 0
1.230 -> 1.23
00123 -> 123
012.30400 -> 12.304
0102 --> 102"
So far i have came up with this
(?<=,|^)(?:[0.+-]+(?=0(?:,|.\B|$))|0+(?=[1-9]))|.0+\b|\b0+(?=\d*.\b)|.\B|(?<=[1-9])0+(?=,|$)
the only problem for 0.1 it returns .1 otherwise it works