Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Willie Howell   on Jan 27 In Java Category.

  
Question Answered By: Sherri Parker   on Jan 27

Here is a quick example:

import java.text.DecimalFormat;

class Format{
public static void main(String[] args){
String input = "12345678.2";
DecimalFormat formatter = new
DecimalFormat("#,###,###.00");
String s = formatter.format(
Double.parseDouble(input) );
System.out.println( s );
}
}

Share: 

 

This Question has 6 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Formatting a Number Or get search suggestion and latest updates.


Tagged: