Skip to content

Instantly share code, notes, and snippets.

@zivce
Created April 17, 2021 16:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zivce/6038a59336ae120fa2c6d61645ed6966 to your computer and use it in GitHub Desktop.
Save zivce/6038a59336ae120fa2c6d61645ed6966 to your computer and use it in GitHub Desktop.
private int readExpirationAsInt(Milk milk)
{
String expiration = milk.getExpiration();
try {
return Integer.parseInt(expiration);
}
catch(NumberFormatException ignored) {}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment