Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Servlets
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Servlets
Float Number
Joey Alencar
Ranch Hand
Posts: 43
posted 22 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I'd like to know how can I set a float variable in this format:
999999.99 (Scale = 2).
Thanks.
Bosun Bello
Ranch Hand
Posts: 1514
posted 22 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
If you are trying to format a number to a specific number of decimal places, check out the DecimalFormat class in java.text package.
Bosun
Bosun (SCJP, SCWCD).
So much trouble in the world -- Bob Marley
Marcos Maia
Ranch Hand
Posts: 977
posted 22 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Take a look at:
http://www.java.sun.com/docs/books/tutorial/java/data/decimalFormat.html
I think it will solve your problem.
Consider Paul's
rocket mass heater
.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Float to Int(VERY URGENT)
Precision?
WA #2 ..... word association
Tech Word Game
Lost hours of humanity
More...