Skip to content

Instantly share code, notes, and snippets.

@M-ZubairAhmed
Created February 13, 2017 10:04
Show Gist options
  • Save M-ZubairAhmed/c51691c9c990eabc29814d4ff0cf5f8d to your computer and use it in GitHub Desktop.
Save M-ZubairAhmed/c51691c9c990eabc29814d4ff0cf5f8d to your computer and use it in GitHub Desktop.
To check if a Number has decimal places
/*
One of the easiest ways to check if a number after it comes back from some function is an Integer or not is to check its remainder with 1. eg.
if(Number % 1 == 0){
print "this is a perfect integer"}
else{
print "this is a real number with decimal places"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment