Last active
May 17, 2020 14:49
-
-
Save tlylt/addde37e4546a5a079b674dff1f69697 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Use % 100 to get the last two digits of a number | |
--- 430 % 100 => 30 | |
Use // 100 to get the first digit of a number | |
--- 430 //100 => 4 | |
Use % 10 to get the last digit of a number | |
--- 430 % 10 => 0 | |
Conclusion | |
- Use //10 to get from the left | |
//10, remove 1 digit from right | |
//100, remove 2 digits from right | |
- Use %10 to get from the right |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment