code: private static String trimZerosFromEnd(String string) {
          return string.contains(".") ? string.replaceAll("0*$", "").replaceAll("\\.$", "") : string;
      }
docs: The function to remove trailing zeros from the decimal part of the numerals represented by a string.
  If there are no digits after the point, the point is deleted as well.
  
  @param string the input string trailing zeros.
  @return the string without trailing zeros.