If the last digit is less then or equal to 5 then it can be rounded to the nearest ( previous ) multiple of 10 by just replacing the last digit with 0
if ( ord ( str [ n - 1 ] ) - ord ( '0' ) <= 5 ) : NEW_LINE