In 1986 I did that in Turbo Pascal 3.0 for DOS. Had a bug with the round function so I made my own nround that converted the floating point to a string then parsed the string to find the right rounding and converted it back to a float. I was the only person in class to get the correct answer and graded down by my professor and accused of hacking.