| Author |
conversion of 1.0000000000005117E-4 to 0.00001
|
Gowrishankar Mudaliar
Ranch Hand
Joined: Oct 20, 2001
Posts: 39
|
|
Hi All, I am having a program like this. It evaluates an expression like " 1.00*(100-99.99)/100 ". The result is a number in exponential format. But i only want a number in normal format. Is there a way i can achieve this straight forwardly. public class ATLDiscount { public static void main(String ar[]) throws ParseException { double dIntermediateCalcCost = 0,dPrice = 0,dVal = 0; dPrice = 1.00; dVal= 99.99; dIntermediateCalcCost = dPrice*(100-dVal)/100; System.out.println("Intermediate COst double..:"+dIntermediateCalcCost); } } Thanks Gowri
|
 |
Ernest Friedman-Hill
author and iconoclast
Marshal
Joined: Jul 08, 2003
Posts: 24039
|
|
Use java.text.DecimalFormat. This isn't an advanced question; I'm moving this to JiG(Intermediate).
|
[Jess in Action][AskingGoodQuestions]
|
 |
 |
|
|
subject: conversion of 1.0000000000005117E-4 to 0.00001
|
|
|