title: How to format number with special character using DecimalFormat in java
body: <p>I would like to format  numbers like 12-345-67 in java. Is there any possible ways to do? I have tried the below code:</p>
  
  <pre><code>double d =123456789;
  DecimalFormat df = new DecimalFormat("[##'-'##'-'##]");
  String result = df.format(d);//output: [123456789--]
  </code></pre>
  
  <p>Thanks in advance</p>