I'm comparing appstore version with version in the app build. By mistake I entered 15 instead of 15.0 in the build version in the app code. Following compare fails
appStoreAppVersion = "15.0"
currentVersion = "15"
if appStoreAppVersion.compare(currentVersion, options: .numeric) == .orderedDescending {
}
Using above compare gives me "15.0" > "15" so it fails. I thought "15.0" will be equal to "15"
How to fix this compare function so that it takes care of the decimal values for checking version? Is there any existing compare function which can take care of the decimal values as well?