@@ -0,0 +1,646 @@
+package com.levelup.java.number;%0A%0Aimport static org.junit.Assert.assertEquals;%0A%0Aimport java.text.DecimalFormat;%0Aimport java.text.ParseException;%0A%0Aimport org.junit.Test;%0A%0A/**%0A * This java snippet will demonstrate converting%0A * a formatted string to a number%0A * %0A * @author Justin Musgrove%0A * @see %3Ca href='http://www.leveluplunch.com/java/'%3E%3C/a%3E%0A * %0A */%0Apublic class FormattedStringToNumber %7B%0A%09%0A%09@Test%0A%09public void convert_formatted_string_to_number_java () throws ParseException %7B%0A%09%09DecimalFormat df = new DecimalFormat(%22#,##0.00;(#,##0.00)%22);%0A%09%09%0A%09%09Number parsedNumber = df.parse(%22123,234.25%22);%0A%09%09%0A%09%09assertEquals(123234.25, parsedNumber);%0A%09%7D%0A%09%0A%7D%0A

add formatted string to number