CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2009
    Posts
    45

    DecimalFormat Class (Question on what the # does)

    Here is my code:
    Code:
    import java.text.DecimalFormat;
    
    import java.util.Scanner;
    
    public class decform_checker
    {
    	public static void main (String [] args)
    	{
    		Scanner kb = new Scanner(System.in);
    		
    		double number = kb.nextDouble();
    		
    		DecimalFormat formatter = new DecimalFormat("#0,000.000%");
    		System.out.println(formatter.format(number));
    	}
    }
    I would appreciate it if somebody could explain what the # does in detail because I don't understand what I read on it and I don't find much to read about it either.

    Thanks in advance!

  2. #2
    Join Date
    Apr 2009
    Location
    TR
    Posts
    97

    Re: DecimalFormat Class (Question on what the # does)

    take a look Special Pattern Characters...

    DecimalFormat

    Please use code tags like this :
    [SIGPIC][/SIGPIC]
    Code Your Dreams

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured