This site requires JavaScript, please enable it in your browser!
Greenfoot back
SwaggyXiao
SwaggyXiao wrote ...

2020/11/20

Error When Constructing the World

SwaggyXiao SwaggyXiao

2020/11/20

#
I made a world in the Greenfoot, and it works really well in the greenfoot app, but when i upload it to the website, it says java.util.UnknownFormatConversionException. Anyone knows why?
danpost danpost

2020/11/20

#
SwaggyXiao wrote...
I made a world in the Greenfoot, and it works really well in the greenfoot app, but when i upload it to the website, it says java.util.UnknownFormatConversionException. Anyone knows why?
I have not seen that one before, but if you supply your codes for review, we might be able to figure it out. Start with posting your World subclass.
SwaggyXiao SwaggyXiao

2020/11/22

#
String strDouble = String.format("%.2f", 2.00023); System.out.println(strDouble); // print 2.00 Read more: https://www.java67.com/2014/06/how-to-format-float-or-double-number-java-example.html#ixzz6eO0dVyZ9
danpost danpost

2020/11/22

#
Try: 2.00023d or (double)2.00023
You need to login to post a reply.