27.11.2017, 20:21
(26.11.2017, 20:04)Selur Wrote:Looks like there might not be a simple fits-all solution to the problem, however having the user specifying replacements here is still the wrong way to go since: 'scenecut-bias=0.05' > 'scenecut-bias=05' if Replacements are ".000%#.00%#.0%".Quote:Thus my later suggestion for optional removal of trailing post-decimal-point zeroes, instead.Which isn't a good idea unless you always make sure you use a specific language when using MediaInfo.
German: 1,000 = 1 and 1.000 = 1 000
US: 1.000 = 1 and 1,000 = 1 000
-> letting the user specify replacements is the more generic and saver way.
This is not something the user can themselves address, since they are unable to search for line breaks or word boundaries. Also to remove the excess zeroes in lines like: 'ipratio=1.40 pbratio=1.20 qcomp=0.80' using Replacements, the user would have to list out all possible number combinations one by one as they have no access to wildcards.
Did some experimenting to figure out a RegEx that would work reliably in all likely usage scenarios and here's the result:
Find: ([\.|\,]\d*[^0])0+\b|[\.|\,]0+\b
Replace: $1
So perhaps something like this:
[--ZeroTrim=<decimal separator(s)>]
--ZeroTrim: Removes excess zeroes after user specified decimal separator is detected.