We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Java Currency Formatter
Java Currency Formatter
Sort by
recency
|
865 Discussions
|
Please Login in order to post a comment
import java.io.; import java.util.; import java.text.*;
public class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); double d = sc.nextDouble();
}
I've attempted this problem in five different ways, carefully formatting the output to match the expected results. Despite that, the solution consistently fails on several test cases.
I finally submitted the best version I could, and it passed only 2 out of 8 test cases. At this point, I'm feeling completely stuck.
If anyone has managed to pass all the test cases, I would really appreciate it if you could share your working code. It would help me understand what I'm missing. Thanks in advance!
import java.io.; import java.util.; import java.text.; import java.math.; import java.util.regex.*;
public class Solution {
}
I really had a hard time solving this problem, really. In the end the simple solution was changing java 15 jdk for jdk8 or jdk7. (: