Here you can find the source of unformatAmount(String formattedNumber)
Parameter | Description |
---|---|
string | number to convert |
public static double unformatAmount(String formattedNumber)
//package com.java2s; //License from project: Open Source License import java.text.NumberFormat; import java.text.ParseException; public class Main { /**// w w w . ja v a 2 s. co m * unformats a formatted number to be a double again * * @param string number to convert * @return an unformatted number to be used for db interactions */ public static double unformatAmount(String formattedNumber) { NumberFormat numberFormatter = NumberFormat.getCurrencyInstance(); Number number = null; try { number = numberFormatter.parse(formattedNumber); } catch (ParseException e) { e.printStackTrace(); } double unformattedNumber = number.doubleValue(); return unformattedNumber; } }