jwinterm / LightWallet2

A java based GUI for the Monero simplewallet
15 stars 3 forks source link

java.lang.NumberFormatException after receiving a fraction of a XMR #3

Closed theStack closed 7 years ago

theStack commented 8 years ago

After receiving 0,5 XMR the following exception was thrown: Exception in thread "LWJGL Application" java.lang.NumberFormatException: For input string: "0,5" at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2043) at sun.misc.FloatingDecimal.parseDouble(FloatingDecimal.java:110) at java.lang.Double.parseDouble(Double.java:538) at com.jw.lightwallet.screens.MainScreen.dumptxlist(MainScreen.java:390) at com.jw.lightwallet.screens.MainScreen.runtasks(MainScreen.java:237) at com.jw.lightwallet.screens.MainScreen.render(MainScreen.java:185) at com.badlogic.gdx.Game.render(Game.java:46) at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:215) at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:120)

When starting again, the Exception occurs again:

Exception in thread "LWJGL Application" java.lang.NumberFormatException: For input string: "0,5" at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2043) at sun.misc.FloatingDecimal.parseDouble(FloatingDecimal.java:110) at java.lang.Double.parseDouble(Double.java:538) at com.jw.lightwallet.screens.MainScreen.dumptxlist(MainScreen.java:390) at com.jw.lightwallet.screens.MainScreen.<init>(MainScreen.java:169) at com.jw.lightwallet.screens.PasswordScreen$1.clicked(PasswordScreen.java:92) at com.badlogic.gdx.scenes.scene2d.utils.ClickListener.touchUp(ClickListener.java:89) at com.badlogic.gdx.scenes.scene2d.InputListener.handle(InputListener.java:58) at com.badlogic.gdx.scenes.scene2d.Stage.touchUp(Stage.java:348) at com.badlogic.gdx.backends.lwjgl.LwjglInput.processEvents(LwjglInput.java:316) at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:207) at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:120)

jwinterm commented 8 years ago

That's odd. It seems to be related to the use of a comma for a decimal. I'll see if there's an easy fix maybe this weekend or next.

theStack commented 8 years ago

The problem seems to happen when the transactions text file is read. As a manual workaround, I just replaced the comma by the dot in the text file ("0,5" -> "0.5") and the problem doesn't occur anymore.

jwinterm commented 7 years ago

Disabled tx history for time being, this should eliminate this issue.