You need to sign in to do that
Don't have an account?
iceberg4u
Converting String to Double.
Hi,
I have started facing problems with Double.valueOf(<String>) method.Whenever I send in a String value, the value becomes <smthn>E<smthn>.
Suppose I take a value of "11111111111" I get value as <smthn>E9.I get an error as "unexpected token: E9".
Suppose I take a value of "1111111111" I get value as <smthn>E8.I get an error as "unexpected token: E8".
What modification do I need to do for this??
I am using the results to do some processing.The results are then sent to a dynamice SOQL.
Some portions of the code:
private String m_AmountDue;
public String AmountDue
{
get{return m_AmountDue}
set{m_AmountDue = value;}
}
m_AmountDue = m_AmountDue.trim();
m_AmountDue = m_AmountDue.replace(',','');
Double amountDueDoubleVal = Double.valueOf(CommonHelper.getDoubleValue(m_AmountDue,''));//I get the error here.
Double maxAmount = 0.2 * (CommonHelper.IsNull(amountDueDoubleVal));
Double minAmount = CommonHelper.IsNull(amountDueDoubleVal) - CommonHelper.IsNull(maxAmount);
I hope this helps..