Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Decimal Points

 
Noorulain Khan
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could anyone inform me
How to restrict the decimal points to 4
like
I get some number through random method
like 0.000000000000
made it 1.000000000000 by multiplying etc..
but how to restrict the decimal points like
1.0000
Please help me.
Noorulain
:roll:
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like a job for...
java.text.DecimalFormat!

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic