1 Replies - 1304 Views - Last Post: 22 February 2011 - 07:29 PM Rate Topic: -----

#1 ginabell  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 22-February 11

Settext and decimal places

Posted 22 February 2011 - 07:25 PM

I have a variable declared as a double that I am trying to print out the value of to 2 decimal places. How would I do that?
Is This A Good Question/Topic? 0
  • +

Replies To: Settext and decimal places

#2 pbl  Icon User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8342
  • View blog
  • Posts: 31,880
  • Joined: 06-March 08

Re: Settext and decimal places

Posted 22 February 2011 - 07:29 PM

String str = String.format("%f.2", doubleValue);
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1