hgoebl/mobile-detect.js

floating number wrong: md.version("iPhone")

Closed this issue · 1 comments

code:
var device_type = navigator.userAgent;
var md = new MobileDetect(device_type);
console.log(md.version("iPhone"))

result: should 10.3.1 but 10.31

The 2 decimal places after the version number are not separated

this is how the "logic" is intented. Convert a version string to a single number.
If you need something like SemVer, then consume the version string.