Last active
June 8, 2019 09:55
-
-
Save kkmonster/88c197510a4571e8190ef172e1116431 to your computer and use it in GitHub Desktop.
This file contains 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
float f 1.23; | |
int val1 = f; | |
int val2 = (f * 10) % 10; | |
int val3 = (f * 100) % 10; | |
char buffer[20]; | |
sprintf(buffer, "val = %d.%d%d", val1, val2, val3); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment