mark
mark

Reputation: 959

Java - Disable scientific notation in JTable cells

I have a JTable where a series of Float are displayed. For small values the cell displays the number in scientific notation. Is there a way to disable that?

Upvotes: 0

Views: 762

Answers (1)

skiwi
skiwi

Reputation: 69269

You should read the following page to get an insight about why it is happening: http://docs.oracle.com/javase/tutorial/uiswing/components/table.html#editrender

Then you should pass your own NumberFormat instance (somehow) in to your JTable, and then all numbers will be formatted properly.

I think it's a good read to read through the entire JTable documentation if you decide to work with it for a long time and I am sure that it is mentioned there how to apply the NumberFormat.

Upvotes: 2

Related Questions