lundi 23 août 2021

Conditional Check for App Version Number? [duplicate]

I need to have a conditional check for some feature functionality from the backend (Python), based on the app version.

For Feature X, I want to keep a conditional check in format something like :

if(app_version > 3.1.4) {
  <Do This>
} 
else {
  <Do This>
}

But in this case, this format is not right ">3.1.4".

Is separating each digit and then comparing, the only way or there is some better way to check this. Please suggest.

Aucun commentaire:

Enregistrer un commentaire