S
sanna
I am trying to convert a double value to two decimal places, but when I
enter an amount say 12345678.99000, I get the result as 12345678.99E7
instead of 12345678.99.
Here is what my code looks like....
DecimalFormat df = new DecimalFormat("##############0.00");
boolean appendO = false;
StringBuffer buff = new StringBuffer();
Double amt = new Double(df.format(amount));
String sAmount = amt.toString();
String a = sAmount.replace(',',' ');
StringTokenizer tok = new StringTokenizer(a,".");
while (tok.hasMoreTokens())
{
String token1 = tok.nextToken();
String token2 = tok.nextToken();
if (token2.length()<2)
{
appendO = true;
...................
Thanks,
Swiss
enter an amount say 12345678.99000, I get the result as 12345678.99E7
instead of 12345678.99.
Here is what my code looks like....
DecimalFormat df = new DecimalFormat("##############0.00");
boolean appendO = false;
StringBuffer buff = new StringBuffer();
Double amt = new Double(df.format(amount));
String sAmount = amt.toString();
String a = sAmount.replace(',',' ');
StringTokenizer tok = new StringTokenizer(a,".");
while (tok.hasMoreTokens())
{
String token1 = tok.nextToken();
String token2 = tok.nextToken();
if (token2.length()<2)
{
appendO = true;
...................
Thanks,
Swiss