code: private static int populatePrefixSuffix(
              String pluralVariant, int idx, String template, ULocale locale, String style,
              Data destination, boolean overwrite) {
          int firstIdx = template.indexOf("0");
          int lastIdx = template.lastIndexOf("0");
          if (firstIdx == -1) {
              throw new IllegalArgumentException(
                  "Expect at least one zero in template '" + template +
                  "' for variant '" +pluralVariant + "' for 10^" + idx +
                  " in " + localeAndStyle(locale, style));
          }
          String prefix = template.substring(0, firstIdx);
          String suffix = template.substring(lastIdx + 1);
  
          // Save the unit, and return -1 if it was not saved
          boolean saved = saveUnit(new DecimalFormat.Unit(prefix, suffix), pluralVariant, idx, destination.units, overwrite);
          if (!saved) {
              return -1;
          }
  
          // If there is effectively no prefix or suffix, ignore the actual
          // number of 0's and act as if the number of 0's matches the size
          // of the number
          if (prefix.trim().length() == 0 && suffix.trim().length() == 0) {
            return idx + 1;
          }
  
          // Calculate number of zeros before decimal point.
          int i = firstIdx + 1;
          while (i <= lastIdx && template.charAt(i) == '0') {
              i++;
          }
          return i - firstIdx;
      }
docs: Populates prefix and suffix information for a particular plural variant
  and index (log10 value).
  @param pluralVariant e.g "one", "other"
  @param idx the index (log10 value of the number) 0 <= idx < MAX_DIGITS
  @param template e.g "00K"
  @param locale the locale
  @param style the style
  @param destination Extracted prefix and suffix stored here.
  @return number of zeros found before any decimal point in template, or -1 if it was not saved.