Java console - check specific characters with conditions.
I'm not quite the expert with Java consoles. I'm currently writing a class function that involve s verification of certain characters in my if statements. To clarify, I'd like to state on this function that if, as a decimal number (double), I have a '0' after the comma - eliminate it.
Ex: 12,0 - I'd like to eliminate the ',0' if zero is being returned after 12 (in this case).
Now, in case someone asks me to post this on, I did not code this part yet (since I don't know how to do it). That said, it would be greatly appreciated if someone (who does not favorize critism by the way. Otherwise, please don't reply) could give his input on this.
Do not get into regexps or string manipulation for simple things like this. Localization rules could cause your decimal format regexp or string explosion to fail anyways. Learn to use DecimalFormat instead, check the Java API.
circlical - hosting software development forums * blog