I am attempting to create a program where you can input a float32 into a scanner, and have the output be a truncation of the float, removing all digits from the right of the decimal place.
Example:
Input: 6.7777
Output: 6
The problem I'm having with my code is the ParseFloat conversion is rounding up my number instead of truncating the number.
Example:
Input: 6.7777
Output: 7
-This Is My Code-
I was asked to remove my code. My apologies for any inconvenience.
Any golang savants out there that can help?
I'm starting to think i may be using the wrong functions for my program requirements, can i make this code work? Or do i need to take another approach?
Thank you for any time that can be spared to assist.