Thank guys, for try to help. The parseFloat() in javascript, apparently is little bit powerful,
because it does not matter if version = "5.12a" or version ="assdjf5.12somethinhere" It always return 5.12 take a look and run an example here
https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_parsefloat
Perhaps I can split and kick out the "a" but sometimes the version can be version = "5.1b" or version = "5.67c" (one or two digits after the ".") the nice, the version always have a tail a letter "a" "b" and so on and not more of 3 digits after "." I am thinking, to do a routine to detect how long is version after the "." is size = 2 ok kick the letter in position 3, if size =1 kick the letter in position 2.
Perhaps you can find a clever way to do this