code: private String quoteFormatCharacters(String literal)
     {
        StringBuilder sb = new StringBuilder();
        int length = literal.length();
        char c;
  
        for (int loop = 0; loop < length; loop++)
        {
           c = literal.charAt(loop);
           switch (c)
           {
              case '0':
              case '#':
              case '.':
              case '-':
              case ',':
              case 'E':
              case ';':
              case '%':
              {
                 sb.append("'");
                 sb.append(c);
                 sb.append("'");
                 break;
              }
  
              default:
              {
                 sb.append(c);
                 break;
              }
           }
        }
  
        return (sb.toString());
     }
docs: This method is used to quote any special characters that appear in
  literal text that is required as part of the currency format.
  
  @param literal Literal text
  @return literal text with special characters in quotes