This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Number Format Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "Number Format" Watch "Number Format" New topic
Author

Number Format

Mauro Trevigno
Greenhorn

Joined: Aug 27, 2012
Posts: 18

Hi guys,

What it means the pipes in this case?

Also the number 2 means that im capable to have only 2 numbers before the point ?

And the 4 means four numbers after the point ?




Thank You

Regards,
M
Kemal Sokolovic
Bartender

Joined: Jun 19, 2010
Posts: 792
    
    2

Did you try to run it?
Pipes are part of the string printed to standard output, they have nothing to do with format of the number printed.


The quieter you are, the more you are able to hear.
Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 4739
    
    7

Mauro Trevigno wrote:What it means the pipes in this case?

Exactly what it looks like.

Also the number 2 means that im capable to have only 2 numbers before the point ?

No, it means "at least 2 numbers before the point" - and don't forget that this is a formatting specification.

And the 4 means four numbers after the point ?

Yup.

Winston


Isn't it funny how there's always time and money enough to do it WRONG?
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Number Format
 
Similar Threads
signed bits...
Math.random
Floating Point Arithmetic: Help with denormalized numbers
ceil(),round()
Abundant Numbers