• Post Reply Bookmark Topic Watch Topic
  • New Topic

using DecimalFormat to parse scentific notation  RSS feed

 
jonathan Greens
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the following code outputs 2.0 instead of 2000.0, why?
thanks
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi There!

First step I would take is to split new DecimalFormat("0.#E000").parse("2.0E+003").floatValue() into separate calls and identify what is being returned in each call.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!